/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: #333;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* Sections */
.section {
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* Cards */
.card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

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

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

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

.btn-secondary:hover {
    background: #5a6268;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="time"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

input:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

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

.form-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
}

/* Institution List */
.institution-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.institution-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.institution-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.institution-name {
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 8px;
}

.institution-description {
    color: #666;
    font-size: 0.9em;
}

/* Status Display */
.status-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.running {
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

.status-indicator.stopped {
    background: #dc3545;
}

.status-indicator.waiting {
    background: #ffc107;
}

.status-actions {
    margin-top: 15px;
}

/* QR Code */
#qr-code-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

#qr-code-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    min-width: 400px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin: 15px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#qr-instructions {
    color: #666;
    margin-top: 10px;
    font-size: 16px;
}

/* Logs */
.logs-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-left: 3px solid transparent;
}

.log-entry.error {
    border-left-color: #dc3545;
    color: #ff6b6b;
}

.log-entry.warning {
    border-left-color: #ffc107;
    color: #ffd93d;
}

.log-entry.info {
    border-left-color: #17a2b8;
    color: #4ecdc4;
}

/* Messages */
#messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    background: white;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.message.success {
    border-left: 4px solid #28a745;
}

.message.error {
    border-left: 4px solid #dc3545;
}

.message.info {
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Klip System */
.klip-summary {
    margin-bottom: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
}

.children-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Filter and Sort Controls */
#grade-filter {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#grade-filter:hover {
    border-color: #007bff;
}

#grade-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#sort-alphabetically {
    cursor: pointer;
    margin-right: 5px;
}

.child-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-item.no-klip {
    border-left: 4px solid #dc3545;
}

.child-item.low-klip {
    border-left: 4px solid #ffc107;
}

.child-item.ok-klip {
    border-left: 4px solid #28a745;
}

.child-info {
    flex: 1;
}

.child-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Grades Table */
.grades-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.grades-table thead {
    background: #667eea;
    color: white;
}

.grades-table th,
.grades-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.grades-table th {
    font-weight: 600;
}

.grades-table tbody tr:hover {
    background: #f8f9fa;
}

.grades-table tbody tr:last-child td {
    border-bottom: none;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Fetched Children */
.fetched-children-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

.fetched-child-item {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.fetched-child-item:last-child {
    border-bottom: none;
}

.already-added {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}

/* Error Styling */
.error {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-content form,
.modal-content > div {
    padding: 20px;
}

.weekday-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.assigned-dates-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.assigned-date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    margin-bottom: 5px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.assigned-date-item:last-child {
    margin-bottom: 0;
}

/* Close modal when clicking outside */
.modal.active .modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dashboard Main Card */
.dashboard-main-card {
    margin-bottom: 20px;
}

/* Configuration Section Wrapper */
.config-section-wrapper {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.config-toggle-btn {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: 500;
    color: #667eea;
    transition: all 0.3s ease;
}

.config-toggle-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.config-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

.config-section {
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

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

.config-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.config-nav-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.config-nav-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.config-nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.config-content {
    position: relative;
}

.config-section-content {
    display: none;
}

.config-section-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease, width 0.3s ease;
}

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

.sidebar-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 1.5em;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
    color: #667eea;
}

.nav-item.active {
    background: #f0f4ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.2em;
}

.nav-text {
    flex: 1;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.user-info {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.9em;
    color: #666;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: white;
    transition: margin-left 0.3s ease;
}

/* Collapsed sidebar on desktop */
.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

/* Show close button on desktop */
#sidebar-close-btn {
    display: flex;
}

.top-bar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.top-bar .sidebar-toggle {
    display: none;
}

/* Show toggle button on desktop when sidebar is collapsed */
.app-layout.sidebar-collapsed .top-bar .sidebar-toggle {
    display: flex;
}

.top-bar h1 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.content-section {
    padding: 30px;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 260px; /* Keep width on mobile when collapsed, just hide with transform */
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar .sidebar-toggle {
        display: flex;
    }
    
    #sidebar-close-btn {
        display: flex; /* Always show close button on mobile when sidebar is open */
    }

    .content-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2em;
    }

    .institution-list {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .child-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .child-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .grades-table {
        font-size: 0.9em;
    }

    .grades-table th,
    .grades-table td {
        padding: 8px;
    }

    .sidebar {
        width: 100%;
        max-width: 300px;
    }

    .tab-nav {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 5px;
    }

    .tab-btn.active {
        border-left-color: #667eea;
        border-bottom: none;
    }

    .top-bar h1 {
        font-size: 1.2em;
    }

    .content-section {
        padding: 15px;
    }
}

/* Overlay for mobile sidebar */
@media (max-width: 1024px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Modal z-index fix */
.modal {
    z-index: 2000;
}

/* SFO Activities Styles */
.activity-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.activity-card {
    background: #f8f9fa;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.activity-card:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.activity-card.selected {
    border-color: #e74c3c;
    background: #fff5f5;
}

.file-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: #e74c3c;
    background: #fff;
}

.file-upload-area.dragover {
    border-color: #e74c3c;
    background: #fff5f5;
}

/* SFO Display Styles */
#sfo-display-content {
    min-height: 400px;
}

#sfo-display-content .date-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

#sfo-display-content .date-header .date {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

#sfo-display-content .date-header .title {
    font-size: 2.5rem;
    font-weight: bold;
}

#sfo-display-content .activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

#sfo-display-content .activity-card {
    cursor: default;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#sfo-display-content .activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

#sfo-display-content .activity-image-container {
    width: 100%;
    height: 250px;
    background: #e74c3c;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#sfo-display-content .activity-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#sfo-display-content .activity-image-container .fallback-text {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

#sfo-display-content .activity-content {
    padding: 25px;
}

#sfo-display-content .activity-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

#sfo-display-content .activity-description {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

#sfo-display-content .activity-time {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 25px;
}

#sfo-display-content .activity-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

#sfo-display-content .person-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 5px;
}

#sfo-display-content .person-role {
    font-size: 1rem;
    color: #7f8c8d;
}

#sfo-display-content .person-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e74c3c;
    flex-shrink: 0;
}

#sfo-display-content .person-initial {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* SFO Fullscreen Styles */
#sfo-display-content.sfo-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    padding: 60px 40px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
}

#sfo-display-content.sfo-fullscreen .date-header {
    margin-bottom: 50px;
    width: 100%;
    max-width: 1600px;
    padding: 40px;
}

#sfo-display-content.sfo-fullscreen .activities-grid {
    width: 100%;
    max-width: 1600px;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

/* Weekly view day containers in fullscreen */
#sfo-display-content.sfo-fullscreen .weekly-day-container {
    width: 100%;
    max-width: 1600px;
    margin-bottom: 50px !important;
}

/* Weekly view day headers in fullscreen */
#sfo-display-content.sfo-fullscreen .weekly-day-header {
    font-size: 2.5rem !important;
    padding: 30px !important;
}

#sfo-display-content.sfo-fullscreen .weekly-day-header > div {
    font-size: 2.5rem !important;
}

/* Weekly view activities grid in fullscreen */
#sfo-display-content.sfo-fullscreen .weekly-day-container .activities-grid {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)) !important;
    gap: 40px !important;
    padding: 30px !important;
}

#sfo-display-content.sfo-fullscreen .activity-card {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

#sfo-display-content.sfo-fullscreen .activity-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Fullscreen button positioning */
#sfo-fullscreen-btn {
    position: relative;
    z-index: 10000;
}

#sfo-tab-display .card {
    position: relative;
}

/* Fullscreen exit button overlay */
#sfo-fullscreen-exit-btn {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10001 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
    font-weight: bold !important;
    padding: 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    width: 44px !important;
    height: 44px !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
}

#sfo-fullscreen-exit-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* SFO Schedule Styles */
#sfo-daily-schedule .day-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

#sfo-daily-schedule select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-top: 10px;
}

/* SFO Activities List Styles */
#sfo-activities-list .activity-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #e74c3c;
}

/* Responsive SFO Styles */
@media (max-width: 768px) {
    .activity-library-grid {
        grid-template-columns: 1fr;
    }
    
    #sfo-display-content {
        grid-template-columns: 1fr !important;
    }
}

