/* ============================================
   Gaudit SaaS — Custom Styles
   Design System & Utility Classes
   ============================================ */

/* ─── CSS Variables (Design Tokens) ────────── */
:root {
    --color-primary:    #6366f1;
    --color-secondary:  #8b5cf6;
    --color-success:    #10b981;
    --color-warning:    #f59e0b;
    --color-danger:     #ef4444;
    --color-bg-light:   #f9fafb;
    --color-dark:       #111827;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base ─────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Gradient Text ────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Buttons ──────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ─── Cards ────────────────────────────────── */
.card {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: var(--transition-base);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ─── Score Circle ─────────────────────────── */
.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-circle .score-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 10;
}

.score-circle .score-bar {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.score-circle .score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

/* ─── Toast Notifications ──────────────────── */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toast-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    max-width: 400px;
}

.toast-success {
    background: rgba(16, 185, 129, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.toast-error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.toast-info {
    background: rgba(99, 102, 241, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ─── Loading Spinner ──────────────────────── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Progress Bar ─────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.6s ease;
}

/* ─── Accordion ────────────────────────────── */
.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: var(--transition-base);
}

.accordion-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-base);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-body {
    max-height: 2000px;
}

.accordion-item.active .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-chevron {
    transition: transform 0.3s ease;
}

/* ─── Modal ────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition-base);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ─── Drag & Drop Zone ─────────────────────── */
.drop-zone {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition-base);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

/* ─── Timeline (Action Plan) ───────────────── */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary), transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* ─── Scrollbar ────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Utilities ────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .score-circle {
        width: 120px;
        height: 120px;
    }
    .score-circle .score-value {
        font-size: 2rem;
    }
}
