/* ============================================
   ORIONDNS MODERN APP STYLES
   Based on Enhanced Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Custom Properties - Design System */
:root {
    /* Colors - Refined grayscale palette */
    --color-bg-primary: #0a0a0a;
    --color-bg-secondary: #0d0d0d;
    --color-bg-elevated: rgba(20, 20, 20, 0.6);
    --color-text-primary: #ffffff;
    --color-text-secondary: #b0b0b0;
    --color-text-tertiary: #707070;
    --color-text-muted: #505050;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #ffffff 0%, #707070 100%);
    --gradient-button: linear-gradient(135deg, #e8e8e8 0%, #a8a8a8 100%);
    --gradient-button-hover: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    --gradient-shine: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 60px;
    --space-2xl: 100px;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows - Layered depth */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7), 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(255, 255, 255, 0.1), 0 0 80px rgba(255, 255, 255, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 Helvetica, Arial, sans-serif;
    background: var(--color-bg-primary);
    min-height: 100vh;
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Add subtle texture like index.css if desired, or keep clean */
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(200, 200, 200, 0.03) 25%, rgba(200, 200, 200, 0.06) 26%, transparent 27%, transparent 74%, rgba(200, 200, 200, 0.03) 75%, rgba(200, 200, 200, 0.06) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(200, 200, 200, 0.03) 25%, rgba(200, 200, 200, 0.06) 26%, transparent 27%, transparent 74%, rgba(200, 200, 200, 0.03) 75%, rgba(200, 200, 200, 0.06) 76%, transparent 77%, transparent);
    background-size: 100px 100px;
    background-attachment: fixed;
}

/* Global Link Styling */
a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* === Navigation (Legacy classes mapped to new style) === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-lg);
    height: 80px;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    background: rgba(10, 10, 10, 0.85);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 14px;
}

/* === Application Containers (Glassmorphism) === */
.dashboard-container, 
.login-container {
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(60px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    width: 100%;
    margin: 60px auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: visible;
}

/* Shine effect for containers */
.dashboard-container::before, 
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.dashboard-container {
    max-width: 1100px;
    padding: var(--space-lg);
}

.login-container {
    max-width: 420px;
}

/* Headers */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.dashboard-header > div {
    display: flex;
    gap: var(--space-xs);
}

/* Dashboard Content */
.dashboard-content {
    color: var(--color-text-secondary);
}

.dashboard-content h2 {
    color: var(--color-text-primary);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* === Button Styles === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Primary Action Button */
.btn-primary, button[type="submit"] {
    background: var(--gradient-button);
    color: #000 !important;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover, button[type="submit"]:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Secondary / Ghost Button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary) !important;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5 !important;
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.25);
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.15);
}

/* Small Button Variant */
.btn-small {
    padding: 6px 14px;
    font-size: 12px;
}

/* === Forms === */
.login-header {
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.login-body {
    padding: var(--space-lg);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--color-text-tertiary);
    font-size: 12px;
}

/* === Tables === */
.dns-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
}

.dns-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dns-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    font-size: 14px;
    transition: background 0.2s;
}

.dns-table tr:last-child td {
    border-bottom: none;
}

.dns-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* === Info Box / API Box === */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-md);
    position: relative;
}

.info-box h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--color-text-primary);
}

.info-box h4 {
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-display {
    background: #000;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* === Grids === */
.form-grid,
.ddns-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* === Alerts === */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    font-size: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { 
    background: rgba(16, 185, 129, 0.1); 
    color: #34d399; 
    border-color: rgba(16, 185, 129, 0.2); 
}

.alert-error { 
    background: rgba(239, 68, 68, 0.1); 
    color: #f87171; 
    border-color: rgba(239, 68, 68, 0.2); 
}

.alert-info { 
    background: rgba(59, 130, 246, 0.1); 
    color: #60a5fa; 
    border-color: rgba(59, 130, 246, 0.2); 
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-neutral { background: rgba(255, 255, 255, 0.1); color: var(--color-text-secondary); border: 1px solid rgba(255, 255, 255, 0.1); }

/* === Visibility Box === */
.visibility-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.visibility-status { font-weight: 600; }
.status-public { color: #34d399; }
.status-private { color: var(--color-text-secondary); }

.subuser-box {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #151515;
    margin: 10vh auto;
    padding: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--space-sm);
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

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

/* === Custom Select === */
.custom-select-container {
    position: relative;
    width: 100%;
    z-index: 100;
}

.custom-select {
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.custom-select-trigger:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.custom-select-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.custom-select-arrow {
    font-size: 10px;
    color: var(--color-text-tertiary);
    transition: transform 0.3s ease;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(20px);
}

.custom-select.open .custom-select-options {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.custom-option.selected {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    font-weight: 600;
}

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

/* === Responsive === */
@media (max-width: 768px) {
    .navbar {
        padding: 0 var(--space-md);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header > div {
        margin-top: 12px;
        flex-wrap: wrap;
    }
    
    .nav-links { display: none; }

    .dashboard-container,
    .login-container { 
        margin: 20px auto; 
        width: 95%;
        padding: var(--space-md);
    }
}

/* Utility Classes for color status */
.text-success { color: #34d399; }
.text-danger { color: #f87171; }
.text-warning { color: #fbbf24; }
.text-muted { color: var(--color-text-muted); }

/* Landing Page Legacy Support (if needed, but index.css covers this usually) */
/* If index.php uses style.css as well, these ensure consistency */
.hero-section {
    padding: 120px 20px;
    text-align: center;
}
.hero-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
