/* ===============================================
   AVYRADESK SOLUTIONS - EXECUTIVE PANEL DESIGN
   Elegant Gold & Dark Theme
   =============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

:root {
    /* Executive Gold Palette */
    --gold-primary: #c9a55c;
    --gold-light: #d4b36a;
    --gold-dark: #b8944d;
    --gold-accent: #e5c589;

    /* Dark Backgrounds */
    --bg-main: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --bg-input: #141414;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #d0d8e0;
    --text-muted: #8b8fa3;
    --text-gold: var(--gold-primary);

    /* Status Colors */
    --success: #6fff81;
    --warning: #ff9f40;
    --error: #ff4444;
    --info: #16e2f5;

    /* Borders & Shadows */
    --border-color: rgba(201, 165, 92, 0.15);
    --border-gold: rgba(201, 165, 92, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 0 32px rgba(201, 165, 92, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-main);
    background-image: radial-gradient(at 40% 20%, rgba(201, 165, 92, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
}

/* ===============================================
   AUTHENTICATION PAGES
   =============================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(10, 10, 10, 0.95));
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 48px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--gold-primary);
    letter-spacing: -1px;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.05rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 4px rgba(201, 165, 92, 0.1);
    background: var(--bg-main);
}

button,
.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--bg-main);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before,
.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

button:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 165, 92, 0.5);
}

button:active,
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(201, 165, 92, 0.15);
    color: var(--gold-primary);
    border: 1.5px solid var(--gold-primary);
}

.btn-secondary:hover {
    background: rgba(201, 165, 92, 0.25);
}

.message {
    padding: 14px 18px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: rgba(111, 255, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(111, 255, 129, 0.3);
}

.message.error {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.message.hidden {
    display: none;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: var(--gold-primary);
}

/* ===============================================
   DASHBOARD LAYOUT
   =============================================== */

.dashboard {
    min-height: 100vh;
}

.dashboard-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-gold);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.dashboard-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gold-primary);
    letter-spacing: -0.5px;
}

.dashboard-header div {
    display: flex;
    align-items: center;
    gap: 24px;
}

.dashboard-header span {
    color: var(--text-secondary);
    font-weight: 600;
}

.dashboard-header button {
    background: rgba(255, 68, 68, 0.15);
    color: var(--error);
    border: 1.5px solid rgba(255, 68, 68, 0.4);
    padding: 10px 20px;
}

.dashboard-header button:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.dashboard-content {
    padding: 48px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 32px;
    color: var(--text-primary);
    letter-spacing: -1px;
}

/* ===============================================
   STATS & CARDS
   =============================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(201, 165, 92, 0.08), rgba(201, 165, 92, 0.02));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    background: linear-gradient(135deg, rgba(201, 165, 92, 0.12), rgba(201, 165, 92, 0.04));
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 12px 0;
    color: var(--gold-primary);
    font-family: 'Playfair Display', serif;
}

code {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    display: block;
    margin: 12px 0;
    color: var(--gold-light);
    word-break: break-all;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
}

.stat-card button {
    margin-top: 16px;
    padding: 10px 18px;
    font-size: 0.9rem;
    width: 100%;
}

/* ===============================================
   AUTOMATION CARDS (NEW)
   =============================================== */

.automations-section {
    margin-top: 48px;
}

.automations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.automation-card {
    background: linear-gradient(135deg, rgba(201, 165, 92, 0.1), rgba(22, 226, 245, 0.05));
    border: 1px solid rgba(201, 165, 92, 0.3);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.automation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(201, 165, 92, 0.2);
}

.automation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.automation-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--gold-primary);
    font-weight: 700;
}

.automation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.pending {
    background: var(--warning);
}

.status-dot.approved {
    background: var(--success);
}

.status-dot.active {
    background: var(--success);
}

.status-dot.inactive {
    background: var(--error);
}

.status-dot.rejected {
    background: var(--error);
}

.automation-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.automation-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.automation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(201, 165, 92, 0.2);
}

.automation-stat {
    text-align: center;
}

.automation-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.automation-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-primary);
    margin-top: 4px;
}

.automation-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.automation-actions button {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
}

.btn-delete {
    background: rgba(255, 68, 68, 0.15);
    color: var(--error);
    border: 1.5px solid rgba(255, 68, 68, 0.4);
}

.btn-delete:hover {
    background: var(--error);
    color: white;
}

/* ===============================================
   MODAL STYLES
   =============================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    animation: fadeInUp 0.4s ease;
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold-primary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.modal-actions button {
    flex: 1;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

/* ===============================================
   EMPTY STATE
   =============================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }

    .dashboard-header {
        padding: 16px 24px;
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-content {
        padding: 24px;
    }

    .dashboard-content h2 {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .automations-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* ===============================================
   SCROLLBAR STYLING
   =============================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-primary), var(--gold-dark));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
}