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

/* Main App Container */
.app {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Content Container */
.content-container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-6);
}

/* Content Rows Container */
.content-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-9);
    padding: var(--space-8) var(--space-6);
    padding-bottom: var(--space-12);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Flex Utilities */
.flex {
    display: flex;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.flex-1 { flex: 1; }
.flex-none { flex: none; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap Utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* Width & Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Section Divider */
.section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-6) 0;
}

/* =============================================
   FREE USER UPGRADE BANNER
   ============================================= */

.free-upgrade-banner {
    margin: 0 var(--space-6);
    margin-top: var(--space-6);
}

.free-upgrade-banner__content {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-7) var(--space-8);
    background: linear-gradient(135deg,
        rgba(212, 175, 125, 0.18) 0%,
        rgba(201, 165, 77, 0.10) 40%,
        rgba(212, 175, 125, 0.14) 100%
    );
    border: 1.5px solid rgba(212, 175, 125, 0.30);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(212, 175, 125, 0.08),
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(212, 175, 125, 0.15);
}

/* Decorative shimmer effect */
.free-upgrade-banner__content::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 125, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Geometric Islamic pattern overlay */
.free-upgrade-banner__content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF7D' stroke-opacity='0.06' stroke-width='0.5'%3E%3Crect x='15' y='15' width='30' height='30' transform='rotate(45 30 30)'/%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.free-upgrade-banner__icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(212, 175, 125, 0.25) 0%, rgba(201, 165, 77, 0.15) 100%);
    border: 1px solid rgba(212, 175, 125, 0.25);
    border-radius: var(--radius-lg);
    color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(212, 175, 125, 0.12);
}

.free-upgrade-banner__text {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.free-upgrade-banner__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #0D0B09;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--ochre) 100%);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.free-upgrade-banner__title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
    letter-spacing: -0.01em;
}

.free-upgrade-banner__desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    max-width: 520px;
}

.free-upgrade-banner__btn {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--ochre) 100%);
    color: #0D0B09;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(212, 175, 125, 0.25);
    letter-spacing: 0.01em;
}

.free-upgrade-banner__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 125, 0.4);
    filter: brightness(1.1);
}

.free-upgrade-banner__btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .free-upgrade-banner__content {
        flex-direction: column;
        text-align: center;
        padding: var(--space-6) var(--space-5);
    }

    .free-upgrade-banner__desc {
        max-width: none;
    }

    .free-upgrade-banner__btn {
        width: 100%;
        justify-content: center;
    }
}

/* Impersonation Banner */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 20px;
    background: #d97706;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.impersonation-banner strong {
    font-weight: 700;
}

.impersonation-banner button {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 4px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.impersonation-banner button:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Push content down when impersonation banner is shown */
.impersonation-banner ~ .sidebar {
    top: 38px;
    height: calc(100vh - 38px);
}

.impersonation-banner ~ .main-content {
    padding-top: 38px;
}
