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

:root {
    /* Light Theme Variables */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --border-color: rgba(255, 255, 255, 0.2);
    --accent-color: #667eea;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-text: #2c3e50;
    --button-bg: #667eea;
    --button-text: white;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: rgba(30, 30, 46, 0.95);
    --bg-card: #2a2a40;
    --text-primary: #e0e0e0;
    --text-secondary: #c0c0c0;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #7c3aed;
    --nav-bg: rgba(30, 30, 46, 0.95);
    --nav-text: #e0e0e0;
    --button-bg: #7c3aed;
    --button-text: white;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(124, 58, 237, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navigation */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--nav-text);
    transition: color 0.3s ease;
}

.nav-brand i {
    color: var(--accent-color);
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.nav-link.active {
    background: var(--accent-color);
    color: var(--button-text);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
    color: var(--text-muted);
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-toggle:hover {
    background: var(--accent-color);
    color: var(--button-text);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Main Content */
.main-content {
    margin-top: 60px;
    padding: 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Tab System */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
}

.card-header {
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.card-header h3 {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    transition: color 0.3s ease;
}

.card-header i {
    color: var(--accent-color);
    transition: color 0.3s ease;
}

/* Buttons */
.btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-color);
}

.btn-secondary {
    background: var(--text-muted);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

select, input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-card);
    color: var(--text-primary);
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

[data-theme="dark"] select:focus, 
[data-theme="dark"] input:focus, 
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    transition: background 0.3s ease;
}

.loading-spinner i {
    font-size: 2em;
    color: var(--accent-color);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.loading-spinner p {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hidden {
    display: none !important;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transition: background 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .nav-link span {
        display: none;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .card-header {
        padding: 15px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }