@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary-magenta: #b4238e;
    --primary-purple: #4b2c8c;
    --accent-orange: #f26522;
    --text-grey: #747376;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary-magenta) 0%, var(--primary-purple) 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light); /* Original clean background */
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

body::before {
    content: '';
    position: fixed;
    top: -20%; left: -20%; right: -20%; bottom: -20%;
    z-index: -1;
    pointer-events: none;
    /* Three massive, elegant sweeping curves styled elegantly (Stripe-like) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1000 1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-200,800 C300,500 400,200 1200,-200' fill='none' stroke='rgba(180, 35, 142, 0.05)' stroke-width='180' stroke-linecap='round'/%3E%3Cpath d='M-200,1000 C200,800 600,100 1200,100' fill='none' stroke='rgba(75, 44, 140, 0.05)' stroke-width='120' stroke-linecap='round'/%3E%3Cpath d='M-200,400 C400,600 800,400 1200,600' fill='none' stroke='rgba(242, 101, 34, 0.03)' stroke-width='80' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* A very subtle blur smooths out the massive SVG ribbons into soft professional light streaks */
    filter: blur(8px);
    animation: flowLines 25s ease-in-out infinite alternate;
}

@keyframes flowLines {
    0% { transform: scale(1) translate(0%, 0%) rotate(0deg); }
    100% { transform: scale(1.1) translate(2%, -2%) rotate(2deg); }
}

/* JS-powered randomized background shapes */
#dynamic-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; /* Keep underneath content using pointer events instead of negative z index to ensure visibility */
    pointer-events: none;
    overflow: hidden;
}

.floating-acc {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    animation-name: randomFloat;
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes randomFloat {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(var(--tx, 10vw), var(--ty, 10vh)) rotate(var(--rot, 20deg)) scale(var(--scale, 1.1)); }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

.heartbeat {
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.05); }
    30% { transform: scale(1); }
    45% { transform: scale(1.05); }
    60% { transform: scale(1); }
}

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

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
header {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.logo {
    height: 50px;
}

.admin-greeting {
    font-weight: 600;
    color: var(--primary-purple);
}

.site-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

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

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.site-nav-link {
    color: #1f2937;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav-link:hover {
    color: var(--primary-magenta);
}

.site-auth-link {
    text-decoration: none;
    color: var(--primary-purple);
    font-weight: 600;
    margin-inline-end: 1rem;
}

.auth-action {
    margin-inline-end: 1rem;
}

.language-switcher {
    display: flex;
    align-items: center;
    /*gap: 0.5rem;*/
}

.lang-button {
    /*display: inline-flex;*/
    /*align-items: center;*/
    /*justify-content: center;*/
    /*gap: 5px;*/
    padding: 0.45rem;
    /*min-width: 42px;*/
    /*border-radius: 999px;*/
    /*border: 1px solid rgba(75, 44, 140, 0.14);*/
    /*background: rgba(255, 255, 255, 0.94);*/
    /*color: #1f2937;*/

    /*box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);*/
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lang-button:hover {
    transform: translateY(-1px);
    /*box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);*/
}

.lang-button.active {
    border-color: rgba(180, 35, 142, 0.32);
    /*box-shadow: 0 12px 24px rgba(180, 35, 142, 0.12);*/
}

.flag {
    width: 35px;
    height: 35px;
    /*border-radius: 4px;*/
    /*position: relative;*/
    /*overflow: hidden;*/
    /*box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);*/
}






body.app-rtl .header-content {
    flex-direction: row-reverse;
}

body.app-rtl .nav-actions,
body.app-rtl .site-nav,
body.app-rtl .logo-container,
body.app-rtl .language-switcher {
    flex-direction: row-reverse;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 44, 140, 0.3);
}

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

.btn-accent:hover {
    background: #d94e10;
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--primary-magenta);
    color: var(--primary-magenta);
}

.btn-outline:hover {
    background: var(--primary-magenta);
    color: white;
}

/* Product Grid */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.product-card {
    background: rgba(255, 255, 255, 0.85); /* Glassmorphism base */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06), 0 10px 20px rgba(180, 35, 142, 0.05);
    border-color: rgba(180, 35, 142, 0.2);
}

.product-image-wrap {
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #fdfdfd 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .product-image {
    transform: scale(1); /* Keep full image visible inside the frame */
}

.image-showcase {
    overflow: hidden;
}

.main-product-img {
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-purple);
    font-weight: 700;
}

.product-desc {
    color: var(--text-grey);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Form Styles */
.form-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-purple);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-magenta);
}

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

/* Brand Grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.brand-card {
    background: rgba(255, 255, 255, 0.85); /* Glassmorphism base */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brand-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(180, 35, 142, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06), 0 10px 20px rgba(180, 35, 142, 0.05);
}

.brand-logo-img {
    max-width: 120px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.brand-card:hover .brand-logo-img {
    transform: scale(1.15); /* Stronger logo pop */
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-purple);
    font-family: 'Outfit', sans-serif;
}

/* View Header */
.view-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.back-link {
    cursor: pointer;
    text-decoration: none;
    color: var(--primary-magenta);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(180, 35, 142, 0.05);
    transition: all 0.3s;
}

.back-link:hover {
    background: rgba(180, 35, 142, 0.1);
}

.hidden {
    display: none !important;
}

/* Real Data Specifics */
.product-card.real-data {
    display: flex;
    flex-direction: column;
    min-width: 350px;
}

.attribute-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.attr-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.25rem;
}

.attr-key {
    font-weight: 600;
    color: var(--primary-purple);
    margin-right: 0.5rem;
}

.attr-val {
    color: var(--text-grey);
    text-align: right;
    word-break: break-word;
}

.product-image-container {
    width: 100%;
    height: 250px;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.product-image-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.client-page-eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary-magenta);
}

.client-page-header,
.client-search-shell,
.client-info-card,
.client-description-card,
.client-gallery-section,
.client-empty-state,
.client-hero,
.client-manage-table {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.client-page-header,
.client-search-shell,
.client-info-card,
.client-description-card,
.client-gallery-section,
.client-empty-state {
    border-radius: 24px;
}

.client-page-header {
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.client-page-title {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 3vw, 3rem);
}

.client-page-subtitle {
    max-width: 680px;
    color: #5f6675;
}

.client-search-shell {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.client-tile {
    height: 100%;
    padding: 1.5rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 252, 0.92) 100%);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    color: inherit;
}

.client-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 45px rgba(75, 44, 140, 0.12);
}

.client-tile-avatar {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(180, 35, 142, 0.08), rgba(75, 44, 140, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.client-avatar-placeholder,
.client-profile-placeholder,
.client-manage-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary-purple);
    background: linear-gradient(135deg, rgba(180, 35, 142, 0.12), rgba(75, 44, 140, 0.1));
}

.client-avatar-placeholder {
    width: 100%;
    height: 100%;
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.client-tile-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #263142;
}

.client-empty-state {
    padding: 2rem;
    text-align: center;
    color: #5f6675;
}

.client-details-page {
    display: grid;
    gap: 1.5rem;
}

.client-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    min-height: 360px;
}

.client-hero-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-hero-fallback {
    background:
        radial-gradient(circle at top left, rgba(242, 101, 34, 0.25), transparent 35%),
        radial-gradient(circle at bottom right, rgba(75, 44, 140, 0.28), transparent 35%),
        linear-gradient(135deg, rgba(180, 35, 142, 0.95), rgba(75, 44, 140, 0.9));
}

.client-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 24, 40, 0.18) 0%, rgba(16, 24, 40, 0.72) 100%);
}

.client-hero-content {
    position: relative;
    z-index: 1;
    min-height: 360px;
    display: flex;
    align-items: end;
    gap: 1.5rem;
    padding: 2rem;
    color: white;
}

.client-hero-title {
    color: white;
    margin-bottom: 0;
    font-size: clamp(2rem, 3vw, 3.25rem);
}

.client-profile-badge {
    width: 156px;
    height: 156px;
    border-radius: 28px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

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

.client-profile-placeholder {
    width: 100%;
    height: 100%;
    font-size: 4rem;
    color: white;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.15));
}

.client-info-card,
.client-description-card,
.client-gallery-section {
    padding: 1.5rem;
}

.client-info-card h2,
.client-description-card h2,
.client-gallery-section h2 {
    margin-bottom: 1rem;
    font-size: 1.45rem;
}

.client-info-row {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid rgba(116, 115, 118, 0.15);
}

.client-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.client-info-label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7b8190;
    font-weight: 700;
}

.client-info-value {
    color: #253142;
    text-decoration: none;
    word-break: break-word;
}

.client-description-card p {
    color: #3c4657;
    white-space: pre-line;
}

.client-gallery-card {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.client-gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.12);
}

.client-gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.client-manage-table {
    border-radius: 22px;
    overflow: hidden;
}

.client-manage-table thead th {
    background: rgba(75, 44, 140, 0.08);
    color: #354152;
    border-bottom: none;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.client-manage-table td,
.client-manage-table th {
    padding: 1rem;
}

.client-manage-table tbody tr:last-child td {
    border-bottom: none;
}

.client-manage-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
}

.client-manage-avatar-fallback {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 1.5rem;
}

@media (max-width: 991.98px) {
    .header-content,
    body.app-rtl .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-actions,
    body.app-rtl .nav-actions {
        justify-content: space-between;
    }

    .client-hero-content {
        align-items: center;
        justify-content: end;
        flex-direction: column;
        text-align: center;
    }

    .client-profile-badge {
        width: 132px;
        height: 132px;
    }
}

@media (max-width: 575.98px) {
    .site-nav,
    .nav-actions,
    .language-switcher {
        width: 100%;
        justify-content: center;
    }

    .site-auth-link,
    .auth-action {
        margin-inline-end: 0;
    }

    .client-page-header,
    .client-search-shell,
    .client-info-card,
    .client-description-card,
    .client-gallery-section,
    .client-empty-state {
        padding: 1.25rem;
    }

    .client-hero {
        min-height: 300px;
    }

    .client-hero-content {
        min-height: 300px;
        padding: 1.25rem;
    }

    .client-profile-badge {
        width: 112px;
        height: 112px;
        border-radius: 22px;
    }
}

/* Custom Scrollbar for Attribute Grid */
.attribute-grid::-webkit-scrollbar {
    width: 4px;
}
.attribute-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.attribute-grid::-webkit-scrollbar-thumb {
    background: var(--primary-magenta);
    border-radius: 10px;
}
