:root {
    --primary-black: rgba(3, 3, 3, 0.877);
    --primary-gold: rgb(153, 131, 7);
    --secondary-gold: #FFD700;
    --text-grey: #808080;
    --text-dark-blue: #00008B;
    --btn-blue: #0000FF;
    --btn-gold: rgb(153, 131, 7);
    --link-gold: rgb(153, 131, 7);
    --white: #ffffff;
    --glass-bg: rgba(73, 100, 143, 0.2);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-glow: rgba(56, 146, 156, 0.3);
    --heading-teal: #38929c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: rgb(20, 12, 1);
    background-image: linear-gradient(rgba(12, 2, 2, 0.92), rgba(12, 2, 2, 0.95)), url('../img/aqtwave.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-grey);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--link-gold);
    transition: color 0.3s;
}

a:hover {
    color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* Initial transparent state with gradient fade for readability */
    background: linear-gradient(to bottom, rgba(160, 133, 11, 0.411) 0%, rgba(0,0,0,0) 100%);
    backdrop-filter: blur(0px);
    padding: 1.2rem 0;
    border-bottom: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled State - Glassmorphism Luxury Look */
header.scrolled {
    background: rgba(36, 33, 12, 0.85); /* Deep dark background */
    backdrop-filter: blur(12px); /* Strong glass blur */
    padding: 0.8rem 0; /* Compact size */
    border-bottom: 1px solid rgba(153, 131, 7, 0.3); /* Subtle gold border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Deep shadow */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-gold);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    align-items: center;
}

.nav-links li a {
    color: var(--white);
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-gold);
    transition: width 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 5px var(--primary-gold);
    border-radius: 50px;
}

.nav-links li a:hover {
    color: var(--primary-gold);
    text-shadow: 0 0 8px rgba(153, 131, 7, 0.4);
}

.nav-links li a:hover::after {
    width: 70%;
}

.nav-links li a.active {
    color: var(--primary-gold);
}

.nav-links li a.active::after {
    width: 80%;
    height: 4px;
    box-shadow: 0 0 8px var(--primary-gold);
}

.nav-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-gold);
    color: var(--primary-black);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-icons i {
    color: var(--primary-gold);
    cursor: pointer;
}

/* General Dropdown Behavior for Nav Links */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown:hover .dropdown-menu {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.nav-links .dropdown-menu {
    right: auto;
    left: 0;
    min-width: 180px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-trigger.logged-in {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    transition: background 0.3s ease;
}

.user-trigger.logged-in:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-user-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-gold);
}

.nav-user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-arrow {
    font-size: 0.8rem;
    color: var(--primary-gold);
    transition: transform 0.3s ease;
}

.user-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 220px;
    background: rgba(18, 18, 18, 0.95); /* Darker fallback */
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 10px 0;
    z-index: 1100;
    flex-direction: column;
    margin-top: 15px; /* Spacing from icon */
}

/* Connect the hover area so menu doesn't disappear */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.user-dropdown:hover .dropdown-menu {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.dropdown-menu a {
    color: var(--white);
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    font-size: 0.95rem;
    border-left: 2px solid transparent;
}

.dropdown-menu a:hover {
    background: rgba(153, 131, 7, 0.1);
    color: var(--primary-gold);
    border-left: 2px solid var(--primary-gold);
    padding-left: 25px; /* Slide effect */
}

.dropdown-menu i {
    width: 20px;
    text-align: center;
    color: var(--primary-gold);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

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

.menu-toggle {
    display: none;
    color: var(--primary-gold);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-black);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-bottom: 1px solid var(--primary-gold);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* Main Content Padding */
main {
    padding-top: 100px; /* Space for fixed header */
    min-height: 80vh;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Dashboard Layout */
.user-dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

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

/* User Sidebar */
.user-sidebar {
    padding: 30px 20px;
    position: sticky;
    top: 100px;
}

.sidebar-user-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-gold);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-initial {
    font-size: 2.5rem;
    color: var(--primary-gold);
    font-weight: bold;
}

.sidebar-name {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.sidebar-email {
    color: #aaa;
    font-size: 0.9rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(153, 131, 7, 0.2);
    color: var(--primary-gold);
}

.sidebar-nav a.logout-link:hover {
    background: rgba(212, 0, 0, 0.2);
    color: #ff4d4d;
}

.page-title {
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--white);
}

/* Membership Banner */
.membership-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    margin-bottom: 30px;
    background: linear-gradient(45deg, rgba(153, 131, 7, 0.2), rgba(0, 0, 0, 0.4));
    border: 1px solid var(--primary-gold);
}

.banner-content h2 {
    color: var(--primary-gold);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .membership-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-gold);
}

/* Dashboard Section */
.dashboard-section {
    padding: 30px;
    margin-bottom: 30px;
}

.dashboard-section h3 {
    color: var(--white);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state .sub-text {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 25px;
}

/* Order Tabs */
.order-tabs {
    display: flex;
    gap: 10px;
    padding: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-link {
    padding: 10px 20px;
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-link:hover, .tab-link.active {
    background: var(--primary-gold);
    color: var(--primary-black);
}

.tab-link .badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Search Bar */
.search-bar-container {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form .form-control {
    flex: 1;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(73, 100, 143, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
}

.table-container table {
    min-width: 600px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--primary-gold);
    font-weight: 600;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-gold);
}

.form-control {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--white);
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    backdrop-filter: blur(5px);
}

.form-control:focus {
    outline: none;
    border-color: var(--heading-teal);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(56, 146, 156, 0.3);
}

/* Select Wrapper to ensure consistency */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

select.form-control option {
    background-color: #1a1a1a; /* Dark background for dropdown options */
    color: var(--white);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--glass-border);
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-gold);
    background: rgba(153, 131, 7, 0.1);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-gold);
    margin-bottom: 15px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.help-text {
    color: #aaa;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-out;
    z-index: -1;
}

.btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0.9;
}

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

.btn-secondary {
    background-color: var(--btn-blue);
    color: var(--white);
}

/* Footer */
footer {
    background-color: #010613;
    color: #808080;
    padding: 40px 0 20px;
    border-top: 1px solid var(--primary-gold);
    margin-top: 50px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-col h3 {
    color: var(--primary-gold);
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    font-size: 1.2rem;
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}

/* Sections */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0; /* Removed padding to handle image better */
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible; /* Changed to visible for share popup */
}

.card .card-image {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.card.share-active {
    z-index: 100;
    border-color: var(--primary-gold);
    transform: translateY(-5px); /* Optional: keep it lifted */
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
}

.card h3, .card h4 {
    color: var(--white);
    margin-top: 0;
}

.card-footer {
    margin-top: auto;
}

/* Text Truncation Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    font-size: 1.5rem;
    color: var(--primary-gold);
    margin: 10px 0;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-grey);
    font-size: 1rem;
    margin-left: 10px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

/* Scroll Animation Initial State */
.reveal {
    opacity: 0;
    transform: translateY(30px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease-out;
}

.card-image {
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

/* Social Share Buttons */
.share-container {
    position: relative;
    display: inline-block;
    z-index: 20;
}

.btn-share-trigger {
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share-trigger:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
    box-shadow: 0 0 10px var(--primary-gold);
}

.share-options {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    background: rgba(20, 12, 1, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 8px 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
    margin-bottom: 10px;
}

.share-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Arrow for the tooltip bubble */
.share-options::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(20, 12, 1, 0.95) transparent transparent transparent;
}

.share-btn {
    color: var(--white);
    font-size: 1.1rem;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.whatsapp:hover { color: #25D366; background: rgba(37, 211, 102, 0.1); }
.share-btn.facebook:hover { color: #1877F2; background: rgba(24, 119, 242, 0.1); }
.share-btn.x-twitter:hover { color: black; background: #d9ff03; border: 1px solid rgba(255,255,255,0.3); }
.share-btn.linkedin:hover { color: #0077B5; background: rgba(0, 119, 181, 0.1); }
.share-btn.copy-link:hover { color: var(--primary-gold); background: rgba(153, 131, 7, 0.1); }
