/* ============================================================================
   REGIS - Design System: Trust & Authority
   Legal, Professional, Traditional, Trustworthy, Authoritative
   ============================================================================ */

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

:root {
    /* Brand Colors - Authority Navy & Trust Gold */
    --primary: #1E3A8A;           /* Navy Blue - Authority & Trust */
    --primary-hover: #1E40AF;     /* Darker Navy */
    --primary-light: #EFF6FF;     /* Light Navy background */
    --primary-dark: #172554;      /* Deepest Navy */

    --cta: #B45309;               /* Trust Gold - Professional CTA */
    --cta-hover: #D97706;         /* Brighter Gold */
    --cta-light: #FEF3C7;         /* Light Gold background */

    --secondary: #64748B;         /* Slate Blue */
    --secondary-dark: #334155;     /* Darker Slate */

    --accent: #0EA5E9;            /* Sky Blue - Modern touch */

    --success: #059669;           /* Professional Green */
    --success-light: #D1FAE5;
    --error: #DC2626;             /* Professional Red */
    --error-light: #FEE2E2;
    --warning: #D97706;

    /* Backgrounds */
    --bg-body: #F8FAFC;           /* Very Light Slate */
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F1F5F9;    /* Light Slate */
    --bg-input: #F8FAFC;

    /* Text */
    --text-main: #0F172A;         /* Slate 900 - High contrast */
    --text-muted: #475569;        /* Slate 600 */
    --text-light: #94A3B8;         /* Slate 400 */

    /* Borders & Shadows */
    --border: #E2E8F0;            /* Slate 200 */
    --border-focus: #93C5FD;       /* Blue 300 */
    --border-gold: #FCD34D;        /* Gold border */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.06);
    --shadow-gold: 0 4px 6px -1px rgb(180, 83, 9, 0.15);

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 3rem;
    background-image:
        linear-gradient(180deg, var(--bg-body) 0%, #EFF6FF 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    width: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.7s ease-out;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cta), transparent);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: all var(--transition-normal);
}

.brand-badge:hover {
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.15);
    transform: translateY(-2px);
}

.brand-icon-small {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'EB Garamond', serif;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Main Card
   ========================================================================== */

.main-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid white;
    overflow: visible;
    position: relative;
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--cta), var(--primary));
}

.main-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(30, 58, 138, 0.01) 0%,
        transparent 50%,
        rgba(180, 83, 9, 0.01) 100%
    );
    pointer-events: none;
}

.main-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    min-height: 600px;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

/* ==========================================================================
   Generator Section (Left)
   ========================================================================== */

.generator-section {
    padding: 3rem;
    border-right: 1px solid var(--border);
    background: white;
}

@media (max-width: 900px) {
    .generator-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* --- Tabs --- */

.tabs-container {
    background: var(--bg-surface-alt);
    padding: 0.4rem;
    border-radius: var(--radius-lg);
    display: flex;
    position: relative;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.tabs-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.2;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    position: relative;
    z-index: 2;
    font-family: 'Lato', sans-serif;
}

.tab-btn.active {
    color: var(--primary);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-weight: 700;
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--cta);
    border-radius: var(--radius-full);
    box-shadow: 0 0 6px var(--cta);
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255,255,255, 0.5);
}

/* --- Form Groups --- */

.form-group {
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 10;
}

.form-group:focus-within {
    z-index: 100;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Lato', sans-serif;
}

.input-wrapper {
    position: relative;
    transition: transform var(--transition-normal);
}

.input-wrapper:focus-within {
    transform: translateY(-1px);
}

.input-wrapper {
    position: relative;
    transition: all var(--transition-normal);
    border-radius: var(--radius-lg);
}

.input-wrapper:focus-within::before {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--border-focus);
    border-radius: inherit;
    pointer-events: none;
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* --- Inputs --- */

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-input);
    transition: all var(--transition-normal);
    font-family: 'Lato', sans-serif;
}

.input-field::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-field:hover:not(:focus) {
    border-color: var(--secondary);
}

.btn-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.btn-clear:hover {
    background: var(--error-light);
    color: var(--error);
    transform: translateY(-50%) scale(1.1);
}

/* --- Selection Chips --- */

.selection-chip {
    margin-top: 0.625rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    animation: fadeIn 0.3s;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.08);
    position: relative;
    overflow: hidden;
}

.selection-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--cta));
}

.chip-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    font-size: 1rem;
    line-height: 1;
}

.chip-close:hover {
    background: var(--cta);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

/* --- Buttons --- */

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    position: relative;
    overflow: hidden;
    font-family: 'Lato', sans-serif;
    text-decoration: none;
}

.btn svg {
    flex-shrink: 0;
}

/* Primary Button */
.btn-primary {
    background: var(--cta);
    color: white;
    box-shadow: var(--shadow-gold);
    border: 1.5px solid var(--cta);
}

.btn-primary:hover:not(:disabled) {
    background: var(--cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(180, 83, 9, 0.3);
}

.btn-primary:not(:disabled) {
    position: relative;
    overflow: hidden;
}

.btn-primary:not(:disabled)::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(180, 83, 9, 0.25);
}

/* Secondary Button */
.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--secondary);
    background: var(--bg-surface-alt);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

/* Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled .spinner {
    border-top-color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Info Section (Right)
   ========================================================================== */

.info-section {
    background: linear-gradient(180deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.info-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    border-bottom-color: var(--primary);
}

.info-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: 'Lato', sans-serif;
}

.info-title svg {
    color: var(--cta);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Lato', sans-serif;
}

.info-value {
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-family: 'Lato', sans-serif;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    gap: 1.25rem;
    padding: 3rem 1rem;
}

.empty-icon {
    width: 72px;
    height: 72px;
    color: var(--border);
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   Autocomplete Dropdown
   ========================================================================== */

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 320px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    padding: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

.autocomplete-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, white 100%);
    border-color: var(--border-focus);
    transform: translateX(4px);
}

.dropdown-item {
    position: relative;
    transition: all var(--transition-normal);
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: height var(--transition-normal);
}

.dropdown-item:hover::before {
    height: 70%;
}

.dropdown-main-text {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 0.125rem;
}

.dropdown-sub-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ==========================================================================
   Status Messages
   ========================================================================== */

.status-msg {
    margin-top: 1.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    animation: slideIn 0.3s ease-out;
    font-family: 'Lato', sans-serif;
}

.status-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid var(--success);
}

.status-error {
    background: var(--error-light);
    color: #991B1B;
    border: 1px solid var(--error);
}

.status-msg span:first-child {
    font-size: 1.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 400;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(30, 58, 138, 0.03),
        transparent
    );
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

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

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

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

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .app-container {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 2.25rem;
    }

    .header p {
        font-size: 1rem;
    }

    .generator-section,
    .info-section {
        padding: 2rem 1.5rem;
    }

    .btn-group {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        margin-bottom: 2rem;
    }

    .tab-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .info-value {
        text-align: left;
        max-width: 100%;
    }
}

/* ==========================================================================
   Accessibility & Focus
   ========================================================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--bg-surface-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-md);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}
