/* ========================================
   ROOT VARIABLES & GLOBAL STYLES
   ======================================== */

:root {
    --primary-color: #8a2be2;
    --primary-light: #9400D3;
    --primary-dark: #4b0082;
    --secondary-color: #6f42c1;
    --accent-color: #00d4ff;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --glass-bg: rgba(20, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(138, 43, 226, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-unit: 1rem;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, #1a0a2e 50%, var(--bg-dark) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
}

body {
    min-height: 100vh;
}

/* ========================================
   ADVERTISEMENT SPACES
   ======================================== */

.ad-container {
    background: transparent;
}

.ad-top {
    width: 100%;
    padding: 1rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.ad-placeholder {
    width: 100%;
    min-height: 100px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.5) 0%, rgba(138, 43, 226, 0.05) 100%);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.ad-placeholder:hover {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.6) 0%, rgba(138, 43, 226, 0.1) 100%);
    border-color: rgba(138, 43, 226, 0.4);
}

.ad-label {
    opacity: 0.6;
}

/* ========================================
   AUTHENTICATION MODAL
   ======================================== */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-out;
}

.auth-modal.hidden {
    display: none;
}

.auth-glass-container {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    padding: 3rem 2rem;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-content {
    text-align: center;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-form-section {
    display: none;
}

.auth-form-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.form-group input:focus {
    background: rgba(138, 43, 226, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    transition: width 0.3s ease-out;
}

.form-group input:focus ~ .input-focus-line {
    width: 100%;
}

.auth-toggle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1.5rem;
}

.auth-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-toggle a:hover {
    color: var(--accent-color);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease-out;
    z-index: 0;
}

.btn:hover::before {
    left: 100%;
}

.btn span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: 1px solid rgba(138, 43, 226, 0.5);
    box-shadow: 0 8px 24px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 12px 32px rgba(138, 43, 226, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(138, 43, 226, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.btn-secondary:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.6);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-unlock {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
}

.btn-unlock:hover {
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.6);
    transform: scale(1.05);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dashboard-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    min-height: 100vh;
    transition: var(--transition);
}

.dashboard-container.hidden {
    display: none;
}

@media (max-width: 1440px) {
    .dashboard-container {
        grid-template-columns: 250px 1fr 250px;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }
}

.dashboard-wrapper {
    display: contents;
}

/* ========================================
   SIDEBAR & AD SPACES
   ======================================== */

.sidebar-left,
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: start;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar {
    width: 6px;
}

.sidebar-left::-webkit-scrollbar-track,
.sidebar-right::-webkit-scrollbar-track {
    background: rgba(138, 43, 226, 0.05);
    border-radius: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover,
.sidebar-right::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.5);
}

.sidebar-left .ad-placeholder,
.sidebar-right .ad-placeholder {
    min-height: 600px;
    width: 100%;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
}

.header-content h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

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

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ========================================
   TABS
   ======================================== */

.workspace-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1.75rem;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ========================================
   TAB CONTENT
   ======================================== */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* ========================================
   GLASS CARDS
   ======================================== */

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 12px 40px rgba(138, 43, 226, 0.25);
    transform: translateY(-4px);
}

.card-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.card-header h2,
.card-header h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   UPLOAD ZONES
   ======================================== */

.upload-zone {
    border: 2px dashed rgba(138, 43, 226, 0.4);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(138, 43, 226, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-zone:hover {
    border-color: rgba(138, 43, 226, 0.7);
    background: rgba(138, 43, 226, 0.1);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(138, 43, 226, 0.15);
    box-shadow: inset 0 0 20px rgba(138, 43, 226, 0.2);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    opacity: 0.7;
    transition: var(--transition);
}

.upload-zone:hover .upload-icon {
    color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   IMAGE PREVIEWS
   ======================================== */

.image-preview {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(138, 43, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview.hidden {
    display: none;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.btn-remove:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* ========================================
   TILES PREVIEW GRID
   ======================================== */

.tiles-preview-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tiles-preview-grid.hidden {
    display: none;
}

#tilesPreviewList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.tile-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(138, 43, 226, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tile-thumb:hover {
    transform: scale(1.05);
}

.tile-thumb .btn-remove {
    width: 30px;
    height: 30px;
    font-size: 1.25rem;
    top: 0.5rem;
    right: 0.5rem;
}

.tiles-counter {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 1rem;
    background: rgba(138, 43, 226, 0.05);
    border-radius: 12px;
}

#tileCount {
    color: var(--primary-color);
    font-weight: 700;
}

.btn-remove-all {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.btn-remove-all:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.6);
}

/* ========================================
   CONFIGURATION OPTIONS
   ======================================== */

.config-card {
    margin-top: 2rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-item label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.config-item select {
    padding: 0.75rem 1rem;
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.config-item select:hover,
.config-item select:focus {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.6);
}

.config-item select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.action-buttons .btn-lg {
    min-width: 250px;
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn-lg {
        min-width: unset;
        width: 100%;
    }
}

/* ========================================
   WORKSPACE GRID
   ======================================== */

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.workspace-card {
    min-height: 400px;
}

/* ========================================
   PREVIEW CONTAINER
   ======================================== */

.preview-container {
    display: grid;
    gap: 2rem;
}

.preview-card {
    min-height: 600px;
}

.preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .preview-content {
        grid-template-columns: 1fr;
    }
}

.preview-images {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-item label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.preview-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(138, 43, 226, 0.1);
}

.tile-thumbnails {
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

#previewTilesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
}

.preview-tile {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.preview-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-stats h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.preview-stats ul {
    list-style: none;
}

.preview-stats li {
    padding: 0.75rem;
    background: rgba(138, 43, 226, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.preview-stats strong {
    color: var(--text-primary);
}

/* ========================================
   PROCESSING STATE
   ======================================== */

.processing-state.hidden,
.results-state.hidden {
    display: none;
}

.processing-card {
    text-align: center;
    padding: 4rem 2rem !important;
}

.processing-header {
    margin-bottom: 3rem;
}

.processing-header h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.processing-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(138, 43, 226, 0.2);
    border-top-color: var(--primary-color);
    border-right-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    animation: progressFill 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

#processingText {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   RESULTS CONTAINER
   ======================================== */

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    display: flex;
    flex-direction: column;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.result-header h3 {
    font-size: 1.5rem;
}

.result-badge {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(0, 212, 255, 0.2));
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: var(--accent-color);
}

.result-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(138, 43, 226, 0.1);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-image.blurred {
    filter: blur(20px);
}

.result-image-container.locked {
    position: relative;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 5;
}

.lock-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-color);
    opacity: 0.8;
}

.lock-overlay p {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.unlock-button-overlay {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.unlock-button-overlay .btn-unlock {
    width: 90%;
}

.result-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(138, 43, 226, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
}

.result-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-info strong {
    color: var(--text-primary);
}

.result-card .btn {
    margin-top: auto;
}

.premium-locked {
    opacity: 0.9;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(138, 43, 226, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(138, 43, 226, 0.4);
    border-color: var(--primary-color);
}

.upgrade-content {
    padding: 3rem 2rem;
}

.upgrade-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upgrade-content > p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.upgrade-benefits {
    margin: 2rem 0;
}

.benefit-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(138, 43, 226, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
}

.benefit-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.benefit-item strong {
    color: var(--text-primary);
}

.pricing-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.pricing-card {
    padding: 2rem;
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 16px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    border-color: rgba(138, 43, 226, 0.5);
    transform: translateY(-4px);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(0, 212, 255, 0.05));
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
}

.savings {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(138, 43, 226, 0.4);
    animation: slideInUp 0.4s ease-out;
    z-index: 3000;
}

.toast.hidden {
    display: none;
}

.toast.error {
    background: linear-gradient(135deg, #ff4444, #cc0000);
}

.toast.success {
    background: linear-gradient(135deg, #00d084, #00a85c);
}

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

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

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

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.875rem;
    }

    .auth-glass-container {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .dashboard-header h1 {
        font-size: 1.875rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .upgrade-content {
        padding: 2rem 1.5rem;
    }

    .upgrade-content h2 {
        font-size: 1.5rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .btn-full,
    .action-buttons .btn {
        font-size: 0.95rem;
        padding: 0.75rem 1.25rem;
    }

    .auth-glass-container {
        padding: 1.5rem 1rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 1.25rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .pricing-card.featured {
        transform: scale(1);
    }

    .pricing-options {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
    display: none !important;
}