/* Child Life Calendar - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #2c3e50;
    color: white;
    overflow: hidden;
    height: 100vh;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Video Player Styles */
.video-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.video-controls button {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.video-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Display View Styles */
.calendar-display {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
}

.calendar-header {
    background: #76c2ef;
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.calendar-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
}

.month-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

.week-dates {
    font-size: 1.2rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.qr-code {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #333;
}

.qr-code.active {
    display: flex;
}

.qr-content {
    text-align: center;
}

.calendar-body {
    background: #e55a5c;
    border-radius: 10px;
    padding: 30px;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.day-column {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.day-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
    color: white;
}

.day-date {
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.time-slot {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    min-height: 80px;
}

.time-label {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: white;
}

.event-text {
    font-style: italic;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.3;
}

.weekend-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
}

.weekend-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: white;
}

/* Editor View Styles */
.editor-view {
    display: none;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    background: #5f7c8a;
}

.editor-header {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.editor-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    background: #7f8c8d;
    color: white;
    transition: background-color 0.3s;
}

.tab-button.active {
    background: #3498db;
}

.tab-button:hover {
    opacity: 0.8;
}

.month-selector {
    margin-bottom: 15px;
}

.month-selector select,
.month-selector input {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-right: 10px;
}

.editor-body {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.editor-day {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    color: #333;
}

.editor-day h3 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.editor-day .date-display {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.editor-slot {
    margin-bottom: 15px;
}

.editor-slot label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.formatting-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.formatting-toolbar button {
    padding: 4px 8px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.formatting-toolbar button:hover {
    background: #e9ecef;
}

.editor-slot textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
}

.weekend-editor {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    color: #333;
}

.weekend-editor h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.weekend-editor textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

/* Video Editor Styles */
.video-editor {
    display: none;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    background: #34495e;
}

.video-header {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.video-header h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.folder-selection {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.folder-input {
    display: none;
}

.folder-display {
    flex: 1;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.video-day {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    color: #333;
}

.video-day h3 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.video-day .date-display {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.video-slot {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
}

.video-slot label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.video-entry {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    align-items: center;
}

.video-entry select {
    flex: 1;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

.video-entry .remove-video {
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.video-entry .remove-video:hover {
    background: #c82333;
}

.add-video-btn {
    width: 100%;
    padding: 6px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 5px;
}

.add-video-btn:hover {
    background: #218838;
}

.add-video-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

/* Alert/Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

.notification.info {
    background: #3498db;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calendar-title {
        font-size: 2.5rem;
    }
    
    .month-title {
        font-size: 1.8rem;
    }
    
    .editor-body,
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .calendar-body,
    .editor-body,
    .video-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .controls,
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .calendar-title {
        font-size: 2rem;
    }
    
    .month-title {
        font-size: 1.5rem;
    }
    
    .week-dates {
        font-size: 1rem;
    }
    
    .formatting-toolbar {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .calendar-display,
    .editor-view,
    .video-editor {
        padding: 10px;
    }
    
    .calendar-header {
        padding: 20px;
    }
    
    .calendar-title {
        font-size: 1.5rem;
    }
    
    .month-title {
        font-size: 1.2rem;
    }
    
    .controls button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .calendar-header {
        border: 2px solid white;
    }
    
    .day-column {
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
    
    .time-slot {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .tab-button,
    .controls button,
    .formatting-toolbar button {
        transition: none;
    }
    
    .notification {
        transition: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* Dark Theme Support (if system preference is dark) */
@media (prefers-color-scheme: dark) {
    .editor-header,
    .video-header,
    .editor-day,
    .video-day,
    .weekend-editor {
        background: rgba(45, 55, 72, 0.9);
        color: #e2e8f0;
    }
    
    .editor-slot textarea,
    .weekend-editor textarea,
    .video-entry select,
    .month-selector select,
    .month-selector input {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .formatting-toolbar button {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .formatting-toolbar button:hover {
        background: #718096;
    }
}