/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --border-focus: rgba(79, 70, 229, 0.5);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.05);
    
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning-color: #f59e0b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.05);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--primary-glow);
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
}
body::before {
    top: 10%;
    left: 5%;
}
body::after {
    bottom: 10%;
    right: 5%;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--text-primary);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.auth-container {
    max-width: 450px;
    margin: 6rem auto;
    padding: 1.5rem;
}

/* Cards & Glassmorphism */
.card {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
}
.card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    transform: translateY(-2px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Header & Navigation */
header.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}
.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}
.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}
.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.03);
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.35);
}
.btn-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.15);
}
.btn-danger {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.1);
}
.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Choice fields (Checkbox/Radio) customization */
.choice-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.choice-item {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.choice-item:hover {
    background-color: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
}
.choice-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.choice-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    margin-right: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.choice-item input[type="radio"] + .choice-indicator {
    border-radius: 50%;
}
.choice-item input[type="checkbox"] + .choice-indicator {
    border-radius: 4px;
}
.choice-item input:checked + .choice-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}
.choice-item input[type="radio"]:checked + .choice-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}
.choice-item input[type="checkbox"]:checked + .choice-indicator::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}
.choice-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Upload Drop Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background-color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.02);
}
.upload-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(79, 70, 229, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.8rem;
    transition: var(--transition);
}
.upload-zone:hover .upload-icon {
    transform: scale(1.1);
    background-color: var(--primary-color);
    color: white;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-icon.primary { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tables styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}
table.data-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
table.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
table.data-table tbody tr:last-child td {
    border-bottom: none;
}
table.data-table tbody tr:hover td {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}
.badge-success { background-color: var(--success-bg); color: var(--success-color); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger-color); }
.badge-secondary { background-color: #f1f5f9; color: var(--text-secondary); }

/* Switch Toggle Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--success-color);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Builder Workspace styling */
.builder-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}
@media (max-width: 992px) {
    .builder-split {
        grid-template-columns: 1fr;
    }
}
.builder-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.builder-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
    animation: fadeIn 0.3s ease;
}
.builder-item:hover {
    border-color: rgba(0, 0, 0, 0.12);
}
.builder-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.builder-item-num {
    font-weight: 700;
    color: var(--primary-color);
}
.builder-actions {
    display: flex;
    gap: 0.5rem;
}
.builder-options-editor {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #f1f5f9;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.option-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Form Preview Container */
.form-preview {
    border: 1px dashed var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: rgba(79, 70, 229, 0.01);
}
.preview-title {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

/* Form Response View (for PDF export) */
.response-view {
    background-color: white;
    color: #000000;
    font-family: 'Inter', sans-serif;
    width: 210mm;
    height: 297mm;
    padding: 20mm;
    box-sizing: border-box;
    position: relative;
    margin: 0 auto;
}

/* Strip borders, margins, and shadow when exporting to PDF via html2pdf */
.html2pdf__container .response-view {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.response-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #000000;
    padding-bottom: 10px;
}
.response-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000000;
}
.response-meta {
    text-align: right;
    font-size: 0.9rem;
    color: #555555;
}
.response-meta span {
    display: block;
}
.response-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #000000;
}
.response-grid {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.response-item {
    margin-bottom: 15px;
}
.response-question {
    font-weight: bold;
    margin-bottom: 5px;
    color: #000000;
    font-size: 1rem;
}
.response-answer {
    padding-left: 10px;
    border-left: 2px solid #000000;
    color: #333333;
    font-size: 0.95rem;
}

.response-profile-grid {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}
.response-profile-item {
    font-size: 1rem;
    color: #000000;
}
.response-profile-item span {
    font-weight: bold;
}

.response-logo-box {
    display: inline-block;
    font-weight: bold;
}

.response-logo-subtitle {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #555555;
}

/* Print Layout styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    body::before, body::after {
        display: none !important;
    }
    header, .btn, .no-print {
        display: none !important;
    }
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        backdrop-filter: none !important;
    }
    .response-view {
        box-shadow: none !important;
        padding: 20mm !important;
        border: none !important;
        width: 210mm !important;
        height: 297mm !important;
    }
    .response-answer {
        background-color: transparent !important;
        border-left: 2px solid #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive Form Grid and Premium Card Stack Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.question-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.question-card:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.05), 0 0 0 4px rgba(79, 70, 229, 0.08);
    transform: translateY(-1px);
}
.question-card .form-group:last-child {
    margin-bottom: 0;
}

/* Mobile Layout Improvements */
@media (max-width: 600px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    .card {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }
    
    .question-card {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }
    
    /* Responsive margins for the main form */
    main.container {
        margin: 1.5rem auto !important;
    }
    
    /* Logo styling on small screens */
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.95rem;
        border-radius: 6px;
    }
    
    /* Navigation container adjustment */
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    /* Responsive table to block cards for rating multipart */
    .table-responsive {
        border: none;
        overflow-x: visible;
    }
    
    .data-table, 
    .data-table thead, 
    .data-table tbody, 
    .data-table th, 
    .data-table td, 
    .data-table tr {
        display: block;
        width: 100% !important;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background-color: #ffffff;
        padding: 0;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }
    
    .data-table tr:last-child {
        margin-bottom: 0;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }
    
    .data-table td:first-child {
        background-color: rgba(79, 70, 229, 0.03);
        color: var(--primary-color);
        font-weight: 700;
        font-size: 0.95rem;
        border-bottom: 2px solid var(--primary-glow);
        padding: 0.75rem 1rem;
        margin: 0;
        border-radius: 0;
        display: block;
    }
    
    .data-table td:last-child {
        border-bottom: none;
    }
    
    .data-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-secondary);
        font-size: 0.9rem;
        padding-right: 0.5rem;
    }
    
    .data-table td label.choice-item {
        padding: 0.4rem;
        background: transparent;
        border: none;
        margin: 0;
        display: inline-flex;
    }
}

