/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1419;
    color: #e6e8eb;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 30px;
}

.loading-logo i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.loading-logo h1 {
    font-size: 32px;
    font-weight: 700;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.login-container {
    background: #1e293b;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid #334155;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    margin-bottom: 10px;
}

.login-logo i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #e6e8eb;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 16px;
}

.google-signin-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    transition: background 0.3s ease;
}

.google-signin-btn:hover {
    background: #3367d6;
}

.google-signin-btn img {
    width: 20px;
    height: 20px;
}

.login-note {
    margin-top: 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* Dashboard Layout */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: #1e293b;
    padding: 20px 30px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 24px;
    color: #667eea;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e6e8eb;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #94a3b8;
}

.breadcrumb i {
    font-size: 12px;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#userAvatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details span:first-child {
    font-weight: 600;
    color: #e6e8eb;
}

.user-details span:last-child {
    font-size: 12px;
    color: #94a3b8;
}

.logout-btn {
    background: #374151;
    border: 1px solid #4b5563;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #e6e8eb;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #4b5563;
    color: #f9fafb;
}

/* Navigation */
.dashboard-nav {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0 30px;
}

.nav-tabs {
    display: flex;
    gap: 0;
}

.nav-tab {
    background: none;
    border: none;
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: #334155;
    color: #e6e8eb;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #334155;
}

.nav-tab i {
    font-size: 16px;
}

/* Main Content */
.dashboard-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Overview Tab */
.overview-header {
    margin-bottom: 30px;
}

.overview-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e6e8eb;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1e293b;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #334155;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #e6e8eb;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    height: calc(100vh - 300px);
}

.students-grid {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow-y: auto;
    border: 1px solid #334155;
}

.students-grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.student-card {
    background: #334155;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.student-card:hover {
    background: #475569;
    transform: translateY(-2px);
}

.student-card.active {
    border-color: #667eea;
    background: #1e3a8a;
}

.student-card.offline {
    opacity: 0.6;
}

.student-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.student-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.student-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.student-status {
    font-size: 12px;
    color: #666;
}

.student-preview {
    width: 100%;
    height: 120px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
    overflow: hidden;
    position: relative;
}

.student-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-preview.offline {
    background: #f8f9fa;
    color: #999;
}

/* Student Detail */
.student-detail {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #334155;
}

.detail-header {
    background: #334155;
    padding: 20px;
    border-bottom: 1px solid #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e6e8eb;
}

.close-detail {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 16px;
    padding: 5px;
}

.close-detail:hover {
    color: #e6e8eb;
}

.detail-content {
    padding: 20px;
}

.live-screenshot-section,
.current-tab-section,
.activity-log-section {
    margin-bottom: 20px;
}

.live-screenshot-section h4,
.current-tab-section h4,
.activity-log-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #e6e8eb;
    margin-bottom: 10px;
}

/* Screenshot Styles */
.screenshot-container {
    background: #0f1419;
    border: 2px dashed #475569;
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.screenshot-placeholder {
    text-align: center;
    color: #94a3b8;
}

.screenshot-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.screenshot-placeholder p {
    font-size: 14px;
}

.screenshot-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.screenshot-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.screenshot-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s ease;
}

.screenshot-btn:hover {
    background: #5a6fd8;
}

.screenshot-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.screenshot-timestamp {
    font-size: 12px;
    color: #6c757d;
}

.current-tab {
    background: #334155;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.current-tab p {
    font-size: 12px;
    color: #cbd5e1;
    word-break: break-all;
}

.activity-log {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 11px;
    color: #999;
    min-width: 50px;
}

.activity-url {
    font-size: 12px;
    color: #333;
    flex: 1;
    margin-left: 10px;
    word-break: break-all;
}

/* Students Tab */
.students-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.students-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #e6e8eb;
}

.add-student-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.add-student-btn:hover {
    background: #218838;
}

.students-list {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #334155;
}

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #475569;
}

.student-item:last-child {
    border-bottom: none;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-actions {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-remove {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #17a2b8;
    color: white;
}

.btn-edit:hover {
    background: #138496;
}

.btn-remove {
    background: #dc3545;
    color: white;
}

.btn-remove:hover {
    background: #c82333;
}

/* Schedule Tab */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.schedule-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #e6e8eb;
}

.save-schedule-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.save-schedule-btn:hover {
    background: #5a6fd8;
}

.schedule-form {
    background: #1e293b;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    border: 1px solid #334155;
}

.schedule-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.schedule-row label {
    font-weight: 500;
    color: #e6e8eb;
    min-width: 100px;
}

.schedule-row input[type="time"] {
    padding: 8px 12px;
    border: 1px solid #475569;
    border-radius: 4px;
    font-size: 14px;
    background: #334155;
    color: #e6e8eb;
}

.days-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.day-checkbox input {
    margin: 0;
}

.day-checkbox span {
    font-size: 14px;
    color: #333;
}

/* Settings Tab */
.settings-header {
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #e6e8eb;
}

.settings-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.settings-section {
    background: #1e293b;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e6e8eb;
    margin-bottom: 20px;
}

.sites-list {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.site-domain {
    font-size: 14px;
    color: #333;
}

.add-site-form {
    display: flex;
    gap: 10px;
}

.add-site-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-site-form button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-site-form button:hover {
    background: #5a6fd8;
}

/* Activity Tab */
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.activity-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #e6e8eb;
}

.clear-activity-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.clear-activity-btn:hover {
    background: #c82333;
}

.activity-content {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #334155;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #334155;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e6e8eb;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    padding: 5px;
}

.modal-close:hover {
    color: #e6e8eb;
}

.modal-content {
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-left {
        flex-direction: column;
        gap: 15px;
    }

    .breadcrumb {
        font-size: 12px;
    }

    .dashboard-content {
        padding: 20px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-content {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .nav-tab {
        white-space: nowrap;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .overview-stats {
        grid-template-columns: 1fr;
    }

    .students-grid-content {
        grid-template-columns: 1fr;
    }

    .schedule-form {
        padding: 20px;
    }

    .days-selector {
        gap: 10px;
    }
} 