/* Custom styles for the Shared Calendar application */

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calendar grid styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e5e7eb;
    border: 1px solid #e5e7eb;
}

.calendar-day {
    background-color: white;
    min-height: 120px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: #f9fafb;
}

.calendar-day.other-month {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.calendar-day.today {
    background-color: #eff6ff;
    border: 2px solid #3b82f6;
}

.calendar-day.has-events {
    background-color: #fef3c7;
}

.calendar-event {
    background-color: #3b82f6;
    color: white;
    padding: 2px 6px;
    margin: 1px 0;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event:hover {
    background-color: #2563eb;
}

/* Event type colors */
.calendar-event.lesson { background-color: #3b82f6; }
.calendar-event.meeting { background-color: #10b981; }
.calendar-event.exam { background-color: #ef4444; }
.calendar-event.break { background-color: #f59e0b; }
.calendar-event.other { background-color: #8b5cf6; }

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #6b7280;
}

.modal-body {
    padding: 20px 24px;
}

/* Form styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Calendar navigation */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.nav-button {
    padding: 8px;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background-color: #f3f4f6;
}

/* Sidebar styles */
.sidebar {
    background-color: white;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    min-height: 100vh;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.calendar-list-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 4px;
}

.calendar-list-item:hover {
    background-color: #f3f4f6;
}

.calendar-list-item.active {
    background-color: #eff6ff;
    color: #3b82f6;
}

.calendar-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 1px 3px;
    }
    
    .modal-content {
        width: 95%;
        padding: 16px;
    }
}

/* Loading and error states */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.error {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

/* Share link styles */
.share-link {
    background-color: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}