/*
 * Act2Vision Survey System - Styles
 * Tailwind CSS + Custom Act2Vision Branding + Dark Mode
 */

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

/* Tailwind CSS CDN - will be loaded via script tag in header */

/* CSS Variables for theming */
:root {
    /* Act2Vision Colors - Light Mode */
    --color-primary: #e0990a;
    --color-primary-light: #f4ce80;
    --color-primary-dark: #c17d00;
    --color-navy: #121c44;
    --color-slate-dark: #1e293b;
    --color-slate-medium: #334155;
    --color-light-gray: #D1D5DB;
    --color-dark-gray: #111111;

    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    /* Text colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;

    /* Border colors */
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e1;
}

/* Dark mode variables */
.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --border-color: #334155;
    --border-color-dark: #475569;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.375rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff !important;
    box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.05);
    text-decoration: none;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0px 4px 8px 0px rgba(224, 153, 10, 0.3);
}

.btn-secondary {
    background-color: var(--color-navy);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #0d1430;
}

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

.btn-outline:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(224, 153, 10, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Likert Scale Radio Buttons */
.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1rem 0;
}

.likert-option {
    flex: 1;
    position: relative;
}

.likert-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.likert-option label {
    display: block;
    padding: 1rem 0.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-secondary);
    font-weight: 500;
    margin-bottom: 0;
}

.likert-option input[type="radio"]:checked + label {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    transform: scale(1.05);
}

.likert-option label:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    color: var(--color-navy);
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
}

/* Maturity Badge */
.maturity-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ad-hoc { background-color: #fee2e2; color: #991b1b; }
.badge-emerging { background-color: #fed7aa; color: #9a3412; }
.badge-defined { background-color: #fef3c7; color: #92400e; }
.badge-integrated { background-color: #dbeafe; color: #1e40af; }
.badge-optimized { background-color: #d1fae5; color: #065f46; }

.dark .badge-ad-hoc { background-color: #7f1d1d; color: #fecaca; }
.dark .badge-emerging { background-color: #7c2d12; color: #fed7aa; }
.dark .badge-defined { background-color: #78350f; color: #fef3c7; }
.dark .badge-integrated { background-color: #1e3a8a; color: #bfdbfe; }
.dark .badge-optimized { background-color: #064e3b; color: #a7f3d0; }

/* Role Badges */
.badge-consultant { background-color: #f3f4f6; color: #374151; }
.badge-sr_consultant { background-color: #d1fae5; color: #065f46; }
.badge-admin { background-color: #dbeafe; color: #1e40af; }
.badge-superadmin { background-color: #e9d5ff; color: #6b21a8; }
.badge-superadmin_se { background-color: #fce7f3; color: #9d174d; }

.dark .badge-consultant { background-color: #374151; color: #d1d5db; }
.dark .badge-sr_consultant { background-color: #064e3b; color: #a7f3d0; }
.dark .badge-admin { background-color: #1e3a8a; color: #bfdbfe; }
.dark .badge-superadmin { background-color: #581c87; color: #e9d5ff; }
.dark .badge-superadmin_se { background-color: #831843; color: #fce7f3; }

/* Responsive Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background-color: var(--bg-tertiary);
}

/* Alert/Flash Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #059669;
    color: #064e3b;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e3a8a;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    .likert-scale {
        flex-direction: column;
    }

    .container {
        padding: 0 1rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.hidden { display: none; }

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-up {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: rgba(18, 28, 68, 0.9); /* Navy */
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-hiding {
    animation: toast-out 0.3s ease forwards;
}

/* Dark mode toast variation */
.dark .toast {
    background: rgba(255, 255, 255, 0.9);
    color: #121c44;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}
