/* 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;
    color: #667eea;
}

.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 #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Access Denied Screen */
.access-denied-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;
}

.access-denied-container {
    background: #1e293b;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid #334155;
}

.access-denied-header {
    margin-bottom: 30px;
}

.access-denied-logo {
    margin-bottom: 10px;
}

.access-denied-logo i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 10px;
    display: block;
}

.access-denied-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #e6e8eb;
}

.access-denied-subtitle {
    color: #94a3b8;
    font-size: 16px;
}

.access-denied-content p {
    color: #cbd5e1;
    margin-bottom: 15px;
    font-size: 14px;
}

.back-btn {
    background: #667eea;
    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;
    margin-top: 20px;
}

.back-btn:hover {
    background: #5a6fd8;
}

/* Developer Portal Layout */
.dev-portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.portal-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;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userAvatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.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;
    color: #e6e8eb;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #4b5563;
}

/* Navigation */
.portal-nav {
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0 30px;
}

.nav-tab {
    background: none;
    color: #94a3b8;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #e6e8eb;
    background: #334155;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #334155;
}

.nav-tab i {
    font-size: 16px;
}

/* Main Content */
.portal-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: 28px;
    font-weight: 700;
    color: #e6e8eb;
    margin-bottom: 20px;
}

.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;
    border: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #667eea;
    border-radius: 8px;
    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 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.recent-activity, .system-health {
    background: #1e293b;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.recent-activity h3, .system-health h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e6e8eb;
    margin-bottom: 15px;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
}

.activity-message {
    font-size: 14px;
    color: #e6e8eb;
}

.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.health-label {
    font-size: 14px;
    color: #e6e8eb;
}

.health-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.health-status.online {
    background: #10b981;
    color: white;
}

.health-status.offline {
    background: #ef4444;
    color: white;
}

/* Tab Headers */
.districts-header, .teachers-header, .classes-header, .students-header, .screenshots-header, .logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.districts-header h2, .teachers-header h2, .classes-header h2, .students-header h2, .screenshots-header h2, .logs-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #e6e8eb;
}

.add-district-btn {
    background: #10b981;
    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-district-btn:hover {
    background: #059669;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e6e8eb;
    padding: 10px 40px 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
}

.search-box input::placeholder {
    color: #94a3b8;
}

.search-box i {
    position: absolute;
    right: 15px;
    color: #94a3b8;
}

.screenshot-controls, .logs-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.screenshot-controls select, .logs-controls select {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e6e8eb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.refresh-all-btn, .clear-logs-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;
}

.refresh-all-btn:hover, .clear-logs-btn:hover {
    background: #5a6fd8;
}

/* Lists */
.districts-list, .teachers-list, .classes-list, .students-list {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #334155;
    transition: background 0.3s ease;
}

.list-item:hover {
    background: #334155;
}

.list-item:last-child {
    border-bottom: none;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.item-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: #e6e8eb;
    margin-bottom: 4px;
}

.item-details p {
    font-size: 12px;
    color: #94a3b8;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn.view {
    background: #667eea;
    color: white;
}

.action-btn.view:hover {
    background: #5a6fd8;
}

.action-btn.edit {
    background: #f59e0b;
    color: white;
}

.action-btn.edit:hover {
    background: #d97706;
}

.action-btn.delete {
    background: #ef4444;
    color: white;
}

.action-btn.delete:hover {
    background: #dc2626;
}

/* Screenshots Grid */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.screenshot-card {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    overflow: hidden;
}

.screenshot-header {
    padding: 15px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.screenshot-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #e6e8eb;
    margin-bottom: 4px;
}

.screenshot-info p {
    font-size: 12px;
    color: #94a3b8;
}

.screenshot-image {
    width: 100%;
    height: 200px;
    background: #0f1419;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.screenshot-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.screenshot-placeholder {
    color: #94a3b8;
    text-align: center;
}

.screenshot-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* Logs Content */
.logs-content {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    padding: 10px 15px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 15px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    font-size: 12px;
    color: #94a3b8;
    min-width: 80px;
}

.log-level {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 60px;
    text-align: center;
}

.log-level.error {
    background: #ef4444;
    color: white;
}

.log-level.warning {
    background: #f59e0b;
    color: white;
}

.log-level.info {
    background: #667eea;
    color: white;
}

.log-message {
    font-size: 14px;
    color: #e6e8eb;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portal-header {
        padding: 15px 20px;
    }
    
    .header-left {
        gap: 15px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .nav-tabs {
        padding: 0 20px;
    }
    
    .nav-tab {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .portal-content {
        padding: 20px;
    }
    
    .overview-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-box input {
        width: 250px;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
} 