/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-light: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-glow: 0 10px 30px rgba(79, 70, 229, 0.08);
}

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

/* Background Glow Effects - Soft Pastels for Light Mode */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.08;
    pointer-events: none;
}

.bg-glow-1 {
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.bg-glow-2 {
    background: radial-gradient(circle, var(--accent-indigo) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

/* Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-text .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Glassmorphic Cards - Pure white translucent for Bright UI */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.main-card {
    padding: 2.5rem;
    margin-bottom: 2rem;
}

/* Grid Layout for Form */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }
}

.section-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: 0.5px;
}

/* Drag and Drop Zone */
.upload-dropzone {
    border: 2px dashed rgba(79, 70, 229, 0.25);
    border-radius: var(--radius-lg);
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent-indigo);
    background: rgba(79, 70, 229, 0.03);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-dropzone:hover .upload-icon {
    transform: translateY(-5px);
}

.upload-dropzone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-dropzone p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* File Info Box */
.file-info-container {
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    color: var(--danger-color);
}

.file-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.remove-file-btn:hover {
    color: var(--danger-color);
}

/* Form Settings */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Select Styling */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

select {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    appearance: none;
    outline: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

select:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* Fix option visibility in dropdown menus (force dark text on light bg) */
select option {
    color: #0f172a !important;
    background-color: #ffffff !important;
}

/* Ranks Inputs Grid */
.ranks-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

@media (max-width: 480px) {
    .ranks-input-grid {
        grid-template-columns: 1fr;
    }
}

.rank-input-box {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rank-input-box label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    color: var(--text-primary);
}

input[type="number"] {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input[type="number"]:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.field-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.double-col {
    grid-column: 1 / -1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.25);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

.btn-glow:hover::after {
    left: 120%;
}

.icon-left {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Loading Section */
.loading-section {
    padding: 4rem 2rem;
    text-align: center;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-top: 3px solid var(--accent-indigo);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-section h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
}

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

/* Dashboard & Stats */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.dashboard-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-icon-wrapper.blue {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-blue);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.stat-icon-wrapper.purple {
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent-indigo);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.stat-icon-wrapper.orange {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning-color);
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.stat-icon-wrapper.green {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success-color);
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Results Table Card */
.table-card {
    padding: 2rem;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#table-search {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#table-search:focus {
    border-color: var(--accent-indigo);
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.filter-chip {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.25);
}

.filter-chip.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* Table Design */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    background-color: #f1f5f9;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
    font-weight: 400;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.35rem;
}

.badge-quota {
    background: rgba(79, 70, 229, 0.07);
    color: var(--accent-indigo);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge i {
    font-size: 0.65rem;
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* --- Commercial and Modal Styles --- */

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

.user-display {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.04);
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Card */
.modal-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    position: relative;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-modal-card {
    max-width: 500px;
}

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

.close-modal-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal-btn:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-icon {
    font-size: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    display: inline-block;
}

.modal-icon.accent-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Phone Input */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.country-code {
    background: #f1f5f9;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-right: 1px solid rgba(15, 23, 42, 0.1);
}

.phone-input-wrapper input {
    border: none !important;
    outline: none !important;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    width: 100%;
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
}

/* Payment styles */
.payment-amount-box {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
    margin-bottom: 1.5rem;
}

.pay-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pay-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: #d97706;
}

.order-id-display {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 1rem 0;
}

.order-id-display span {
    font-family: monospace;
    font-weight: bold;
    color: var(--text-primary);
}

/* Pricing Card Banner */
.pricing-banner-card {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(245, 158, 11, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.03);
}

@media (max-width: 768px) {
    .pricing-banner-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 1.5rem;
    }
    .pricing-content {
        flex-direction: column;
        text-align: center;
        margin-right: 0;
        align-items: center;
    }
    .pricing-icon {
        margin-right: 0 !important;
        margin-bottom: 0.75rem;
    }
}

.pricing-content {
    display: flex;
    align-items: center;
}

.pricing-action button {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

/* Locked row layout styles */
.rank-lock-btn {
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.rank-lock-btn:hover {
    background: var(--accent-indigo);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.locked-blur {
    filter: blur(4px);
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

.btn-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--accent-indigo);
}

/* ========================================
   PROFESSIONAL TOAST NOTIFICATION SYSTEM
   ======================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 340px;
    max-width: 480px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    pointer-events: all;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateX(120%);
    opacity: 0;
    font-family: var(--font-body);
    overflow: hidden;
    position: relative;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.toast.toast-error::before { background: #ef4444; }
.toast.toast-success::before { background: #10b981; }
.toast.toast-warning::before { background: #f59e0b; }
.toast.toast-info::before { background: var(--accent-blue); }

.toast.toast-exiting {
    animation: toastSlideOut 0.3s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.toast-info .toast-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.06);
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 4px;
    animation: toastProgress linear forwards;
}

.toast-error .toast-progress { background: rgba(239, 68, 68, 0.4); }
.toast-success .toast-progress { background: rgba(16, 185, 129, 0.4); }
.toast-warning .toast-progress { background: rgba(245, 158, 11, 0.4); }
.toast-info .toast-progress { background: rgba(37, 99, 235, 0.4); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ========================================
   PROFESSIONAL CONFIRM DIALOG
   ======================================== */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: confirmFadeIn 0.2s ease forwards;
    padding: 1rem;
}

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

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

.confirm-overlay.confirm-exiting {
    animation: confirmFadeOut 0.2s ease forwards;
}

.confirm-dialog {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    animation: confirmScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: scale(0.9);
}

@keyframes confirmScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-dialog-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.confirm-dialog-icon.icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.confirm-dialog-icon.icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.confirm-dialog-icon.icon-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
}

.confirm-dialog-icon.icon-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.confirm-dialog-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-dialog-message {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-dialog-actions .btn {
    min-width: 100px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.confirm-btn-cancel {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.confirm-btn-cancel:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
}

/* Toast responsive */
@media (max-width: 600px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    .toast {
        min-width: unset;
        max-width: 100%;
    }
    .confirm-dialog {
        margin: 0 12px;
    }
}
