/* 205 Help Team Admin CMS Styles - Mobile First Design */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.hidden { display: none !important; }

/* Header */
.admin-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: none;
}

.logout-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

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

/* Navigation */
.admin-nav {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-container {
    display: flex;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-item {
    background: none;
    border: none;
    padding: 1rem 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-icon {
    font-size: 1.125rem;
}

/* Main Content */
.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
}

.section-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.search-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    font-size: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-card h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Recent Activity */
.recent-activity {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.recent-activity h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--background-color);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-description {
    font-size: 0.875rem;
}

/* Asset Grid */
.asset-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.asset-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.asset-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.asset-item:hover {
    box-shadow: var(--shadow-md);
}

.asset-preview {
    width: 100%;
    height: 200px;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-secondary);
}

.asset-preview img,
.asset-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-info {
    padding: 1rem;
}

.asset-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.asset-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Upload Section */
.upload-container {
    max-width: 600px;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.upload-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.upload-dropzone h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.upload-progress {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: var(--background-color);
}

.upload-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.settings-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-card h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.setting-item {
    margin-bottom: 1rem;
}

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

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.setting-item input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    margin-right: 0.5rem;
}

.authorized-users {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.authorized-users .user-email {
    background: var(--background-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    display: block;
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.toast {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

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

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

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive Design */
@media (min-width: 640px) {
    .header-container {
        padding: 1rem 2rem;
    }
    
    .nav-container {
        padding: 0 2rem;
    }
    
    .admin-main {
        padding: 2rem;
    }
    
    .user-email {
        display: block;
    }
    
    .section-controls {
        flex-direction: row;
        align-items: center;
    }
    
    .search-input {
        flex: 1;
    }
    
    .filter-select {
        width: 200px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .asset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .activity-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .upload-container {
        max-width: 800px;
    }
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .asset-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .asset-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    .admin-header,
    .admin-nav,
    .upload-dropzone,
    .toast-container,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .admin-section {
        display: block !important;
    }
}