/* ========================================
   Imagify Design System - Global Styles
   Applied to Kamelion - AI Brand Assistant
   ======================================== */

/* Auth Error Overlay Styles */
.auth-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.auth-error-modal {
    background: var(--color-bg-primary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    animation: slideUp 0.3s ease-out;
}

.auth-error-modal h3 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-error-modal p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-error-actions {
    display: flex;
    justify-content: flex-end;
}

.auth-error-actions button {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-error-actions button:hover {
    background: var(--color-primary-dark);
}

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

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--color-text-primary);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-normal);
    position: relative;
}

/* Green Aurora/Glow Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 50%;
    background: var(--gradient-glow-green);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 40%;
    height: 40%;
    background: var(--gradient-glow-green-left);
    pointer-events: none;
    z-index: 0;
}

/* ========== APP SHELL ========== */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ========== GLASS PANEL (Core Component) ========== */
.glass-panel {
    background: var(--gradient-card);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 2px solid var(--color-border-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-inset);
}

.glass-panel-light {
    background: var(--color-bg-button-secondary);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border: 0.833px solid var(--color-border-button);
    border-radius: var(--border-radius-full);
    box-shadow: var(--shadow-inset);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-none);
}

h1 {
    font-size: var(--font-size-3xl);
    letter-spacing: var(--letter-spacing-tighter);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-md);
}

p {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    line-height: var(--line-height-tight);
}

.text-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-label);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* ========== LINKS ========== */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: 14px var(--spacing-2xl);
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
    border-radius: var(--border-radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    line-height: var(--line-height-none);
    height: 44px;
}

.btn-primary {
    background: var(--color-button-primary-bg);
    color: var(--color-button-primary-text);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-button-secondary-bg);
    color: var(--color-text-primary);
    border: 0.833px solid var(--color-border-button);
}

.btn-secondary:hover {
    background: var(--color-bg-hover);
}

.btn-danger {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.btn-danger:hover {
    background: var(--color-error);
    color: var(--color-text-primary);
}

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

/* Icon Buttons */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-bg-button-secondary);
    backdrop-filter: blur(var(--blur-md));
    border: 0.833px solid var(--color-border-button);
    border-radius: var(--border-radius-full);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-inset);
}

.icon-btn:hover {
    background: var(--color-bg-hover);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== INPUTS ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea {
    width: 100%;
    padding: var(--spacing-2xl);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-input);
    border-radius: var(--border-radius-input);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
    transition: all var(--transition-base);
    height: 44px;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.8;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-text-secondary);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 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);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

.animate-slide-in {
    animation: slideIn var(--transition-slow) ease-out;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.gap-xl {
    gap: var(--spacing-xl);
}

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

/* Focus visible styles */
:focus-visible {
    outline: 2px solid var(--color-active);
    outline-offset: 2px;
}

/* ========== RESPONSIVE HELPERS ========== */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .app-shell {
        flex-direction: column;
    }
}

/* =====================================================
   Domain-Based Signup Error Handling Styles
   ===================================================== */

/* Error overlay that covers the entire screen */
.auth-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: auth-error-overlay-fade-in 0.3s ease-out;
}

@keyframes auth-error-overlay-fade-in {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

/* Error modal box */
.auth-error-modal {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    min-width: 400px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    animation: auth-error-modal-slide-in 0.3s ease-out;
    position: relative;
}

@keyframes auth-error-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Error modal title */
.auth-error-modal h3 {
    color: #dc2626;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
}

/* Error modal message */
.auth-error-modal p {
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    color: #374151;
    font-size: 0.95rem;
}

/* Action buttons container */
.auth-error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

/* Primary action button */
.auth-error-actions button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    min-width: 120px;
}

.auth-error-actions button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.auth-error-actions button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.auth-error-actions button:focus {
    ring: 2px solid #93c5fd;
    ring-offset: 2px;
}

/* Responsive design for smaller screens */
@media (max-width: 480px) {
    .auth-error-modal {
        min-width: auto;
        max-width: 90vw;
        margin: 1rem;
        padding: 1.5rem;
    }

    .auth-error-modal h3 {
        font-size: 1.1rem;
    }

    .auth-error-modal p {
        font-size: 0.9rem;
    }

    .auth-error-actions {
        flex-direction: column;
        width: 100%;
    }

    .auth-error-actions button {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auth-error-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .auth-error-modal {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .auth-error-modal h3 {
        color: #ef4444;
    }

    .auth-error-modal p {
        color: #d1d5db;
    }
}
