/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: rgba(255,255,255,0.02);
    --bg-card: rgba(255,255,255,0.02);
    --border-color: rgba(255,255,255,0.05);
    --text-primary: #fff;
    --text-secondary: rgba(255,255,255,0.6);
    --text-muted: rgba(255,255,255,0.3);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 40px 100px rgba(0,0,0,0.5);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

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

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

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
    display: none;
}

.dashboard.active {
    display: block;
}

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

.dashboard-header h2 {
    font-size: 1.5rem;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(255,255,255,0.1);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   SITE CARDS
   ============================================ */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.site-card:hover {
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.site-card .domain {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.site-card .status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: rgba(76,175,80,0.2);
    color: #4CAF50;
}

.status-pending {
    background: rgba(255,193,7,0.2);
    color: #FFC107;
}

.site-card .details {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.site-card .actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.site-card .actions .btn {
    flex: 1;
}

/* ============================================
   FORMS
   ============================================ */
.auth-form {
    display: none;
    max-width: 400px;
    margin: 2rem auto;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: var(--bg-primary);
}

.switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.switch a {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
}

.switch a:hover {
    text-decoration: underline;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content .close {
    float: right;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: var(--transition);
}

.modal-content .close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.settings-panel .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-panel .setting-row:last-child {
    border-bottom: none;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

/* ============================================
   TOGGLE
   ============================================ */
.toggle {
    width: 50px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.toggle.active {
    background: #667eea;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle.active::after {
    left: 25px;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message.success {
    background: rgba(76,175,80,0.1);
    border: 1px solid rgba(76,175,80,0.2);
    color: #4CAF50;
}

.message.error {
    background: rgba(244,67,54,0.1);
    border: 1px solid rgba(244,67,54,0.2);
    color: #ef5350;
}

.message.info {
    background: rgba(33,150,243,0.1);
    border: 1px solid rgba(33,150,243,0.2);
    color: #42a5f5;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 40px 20px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}
