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

:root {
    /* Color Palette - HSL (Premium) */
    --primary-h: 210;
    --primary-s: 100%;
    --primary-l: 50%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), 40%);

    --accent-h: 34;
    --accent-s: 97%;
    --accent-l: 52%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    direction: rtl;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Tajawal', 'Inter', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Grids */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

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

@media (max-width: 768px) {

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

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* --- Product Page Specifics (AliExpress Style) --- */

/* Tabs System */
.tabs-container {
    margin-top: 40px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #fbfbfb;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 15px 30px;
    cursor: pointer;
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 1rem;
}

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

.tab-content {
    padding: 30px;
    display: none;
    line-height: 1.8;
}

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

/* Product Info Visuals */
.price-tag {
    font-size: 2rem;
    font-weight: 800;
    color: #ff4747;
    /* AliExpress Red */
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price-tag small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.vat-text {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
    display: block;
}

/* Trust Badges */
.trust-badges {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.trust-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

/* Sticky Layout */
.product-details {
    max-width: 1200px;
    margin: 40px auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 45% 55%;
    /* More space for info */
    gap: 40px;
    align-items: start;
}

.media-column {
    position: sticky;
    top: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Gallery Improvements */
.main-media-container {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    margin-bottom: 0;
    background: #fff;
    flex: 1;
    order: 2;
    /* Main image on the right (RTL: effectively left visual, but DOM order matters) */
}

/* For RTL: Thumbnails on the right, Image on the left? 
   No, usually thumbnails on the side. 
   If RTL: Flex direction row means items start from right.
   So items: [Thumbnails] [Main Image] 
   Let's check `thumbnails-container`.
*/

.thumbnails-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 70px;
    order: 1;
    /* Thumbnails first */
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.thumbnails-container::-webkit-scrollbar {
    width: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.thumbnail {
    width: 100%;
    /* Fill container width */
    height: 70px;
    /* Fixed height */
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.thumbnail.active {
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.thumbnail:hover {
    border-color: #666;
}

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: fit-content;
    margin: 15px 0;
}

.qty-btn {
    width: 35px;
    height: 35px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    outline: none;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.btn-buy {
    background: #ff4747;
    color: white;
    font-size: 1.1rem;
    padding: 12px;
}

.btn-cart {
    background: #ff9900;
    color: white;
    font-size: 1.1rem;
    padding: 12px;
}

.btn-buy:hover {
    background: #e03e3e;
}

.btn-cart:hover {
    background: #e68a00;
}

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

    .media-column {
        position: static;
        flex-direction: column;
    }

    .thumbnails-container {
        flex-direction: row;
        width: 100%;
        max-height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        order: 2;
        /* Thumbnails below image on mobile */
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .main-media-container {
        order: 1;
    }

    .action-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 10px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
        margin: 0;
    }

    /* Space for fixed buttons */
}

/* --- Store Page Product Cards (Refined & Compact) --- */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08);
    border-color: var(--border-color);
}

.product-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    /* Square images */
    display: block;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    /* Match card radius roughly/inner */
    margin: 6px;
    /* Reduced outer margin */
    width: calc(100% - 12px);
    /* Compensate for margin */
}

.product-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-media {
    transform: scale(1.08);
    /* Subtle zoom */
}

/* Hover video hidden by default */
.hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.product-img-wrapper:hover .hover-video {
    opacity: 1;
}

.product-info {
    padding: 6px 8px 10px 8px;
    /* Further reduced padding for mobile */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    /* Tighter gap */
    text-align: right;
    /* RTL alignment */
}

.product-title {
    font-size: 0.8rem;
    /* Smaller for mobile */
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;

    /* Truncate to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    /* Smaller min-height */
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    display: none;
    /* Hide description for more compact look, or toggle via class if needed. Let's hide it by default for compactness as requested. */
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
    /* Further reduced top padding */
}

.product-price {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
    /* Smaller for mobile */
    position: relative;
}

.product-price::after {
    content: '€';
    font-size: 0.65rem;
    margin-right: 2px;
    color: var(--text-muted);
}

.btn-action {
    padding: 4px 10px;
    /* Even smaller button */
    background: var(--bg-main);
    color: var(--text-main);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.product-card:hover .btn-action {
    background: var(--text-main);
    color: white;
}

/* Responsive Grid Update */
@media (min-width: 1100px) {
    .grid-3 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-3.mobile-grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        /* Tighter gap on mobile */
    }

    .product-info {
        padding: 5px 6px 8px 6px;
    }

    .product-title {
        font-size: 0.75rem;
        min-height: 2.2em;
        line-height: 1.25;
    }

    .product-img-wrapper {
        margin: 3px;
        width: calc(100% - 6px);
    }

    .product-price {
        font-size: 0.85rem;
    }

    .btn-action {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
}

/* --- Top Categories Bar (Premium Pill Design) --- */
.top-categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    margin-bottom: 25px;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */

    /* Fade mask for scrolling hint */
    mask-image: linear-gradient(to left, transparent, black 10px, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to left, transparent, black 10px, black 90%, transparent);
}

.top-categories::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.top-categories a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: transparent;
    /* No background by default for cleaner look, or very soft */
    border: 1px solid transparent;
    /* No border initially */
    border-radius: 50px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
    background: rgba(0, 0, 0, 0.03);
    /* Very subtle background */
}

.top-categories a:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.top-categories a.active {
    background: var(--text-main);
    /* Dark pill for active */
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.top-categories a .cat-count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-right: 6px;
    font-weight: 400;
    display: inline-block;
    vertical-align: middle;
}

.top-categories a.active .cat-count {
    color: rgba(255, 255, 255, 0.8);
}

/* --- Add Product Modal & Form Styles (Premium) --- */
.add-product-btn {
    position: fixed;
    bottom: 75px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 32px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 4px;
    /* Align visual center */
}

.add-product-btn:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--primary-hover);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-main);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    background: var(--bg-card);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Media Uploader */
.btn-add-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    background: var(--bg-main);
}

.btn-add-media:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.05);
}

.media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.media-remove:hover {
    background: #ef4444;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        margin: 0;
        max-width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        max-height: 85vh;
        width: 100%;
    }

    .modal-overlay {
        align-items: flex-end;
        /* Sheet style on mobile */
        padding: 0;
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }

    .add-product-btn {
        bottom: 65px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* --- Profile Page Styles (Consolidated & Premium) --- */

.profile-header {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.profile-cover {
    height: 150px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    position: relative;
}

.profile-avatar-wrapper {
    margin-top: -75px;
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--bg-card);
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin-bottom: 10px;
}

.profile-info {
    padding: 0 30px 40px;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 10px 0 5px;
    color: var(--text-main);
}

.profile-info-item {
    margin: 6px 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* Dashboard Cards Enhancements */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Slightly wider minmax */
    gap: 25px;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.dashboard-card h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    color: var(--text-main);
}

/* List Improvements */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Let li padding handle it */
}

.item-list li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px dashed var(--border-color);
    transition: background 0.2s;
}

.item-list li:last-child {
    border-bottom: none;
}

.item-list li:hover {
    background: transparent;
    /* Clean look */
}

.item-list li img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    margin-left: 15px;
    border: 1px solid var(--border-color);
}

.item-details {
    flex-grow: 1;
    text-align: right;
}

.item-details strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
}

.item-details small {
    color: var(--text-muted);
}

/* Table Improvements */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: auto;
    /* Push to bottom if needed */
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.custom-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
    padding: 15px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.custom-table td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.status-pending {
    background: #fff7ed;
    color: #c2410c;
}

.status-completed {
    background: #ecfccb;
    color: #3f6212;
}

.status-cancelled {
    background: #fef2f2;
    color: #991b1b;
}

/* Edit Toggle */
.edit-details {
    width: 100%;
}

.edit-details[open] summary {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.edit-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    padding: 5px;
    border-radius: 8px;
    transition: color 0.2s;
    list-style: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-details summary:hover {
    color: var(--primary);
}

.edit-details summary::-webkit-details-marker {
    display: none;
}

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

    .profile-cover {
        height: 120px;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-avatar-wrapper {
        margin-top: -60px;
    }

    .profile-actions {
        flex-direction: column;
    }


    .profile-actions .btn {
        width: 100%;
    }
}


/* --- Posts/Feed Page Styles --- */

.feed-layout {
    max-width: 800px !important;
    margin: 40px auto;
    padding-top: 20px;
}

/* Create Post Card */
.create-post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.create-post-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar-small {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.post-input {
    flex: 1;
    border: none;
    background: var(--bg-main);
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 1rem;
    color: var(--text-main);
    resize: none;
    height: 50px;
    transition: var(--transition);
    font-family: inherit;
}

.post-input:focus {
    outline: none;
    background: transparent;
    border: 1px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
}

.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.upload-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    /* Added separator */
    margin-bottom: 10px;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-user-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-content {
    padding: 5px 20px 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    display: block;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.post-footer {
    padding: 15px 20px;
    /* border-top: 1px solid var(--border-color); Removed to avoid double border with image */
    display: flex;
    gap: 20px;
    align-items: center;
}

.post-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

.post-action-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.post-action-btn.like-btn.liked {
    color: #ff4747;
    background: rgba(255, 71, 71, 0.1);
}

.post-action-btn.like-btn.liked i {
    animation: pulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Comments Section */
.comments-section {
    background: var(--bg-main);
    padding: 15px 20px;
    display: none;
    /* Hidden by default */
    border-top: 1px solid var(--border-color);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-bubble {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 18px;
    border-top-right-radius: 4px;
    /* Distinct styling */
    border: 1px solid var(--border-color);
    flex: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comment-user {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.comment-text {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.comment-input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
    font-size: 0.95rem;
}

.comment-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
}

@media (max-width: 600px) {

    .create-post-card,
    .post-card {
        border-radius: 0;
        border-right: none;
        border-left: none;
        margin-bottom: 10px;
    }

    .feed-layout {
        margin-top: 0;
        padding-top: 0;
    }

    .post-card {
        box-shadow: none;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }
}

/* Image Preview Container */
.image-preview-container {
    display: none;
    position: relative;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.image-preview-container.show {
    display: block;
}

.image-preview {
    max-width: 100%;
    border-radius: var(--radius-md);
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.image-remove-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.image-remove-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

/* Comment Avatar */
.comment-avatar {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
}

/* Send Comment Button */
.btn-send-comment {
    padding: 10px !important;
    width: 45px;
    height: 45px;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}


/* Post Submit Button */
.btn-post-submit {
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

/* SVG-based Like Button Styles */
.interaction-btn.like-btn svg,
.like-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.interaction-btn.like-btn.liked svg,
.like-btn.liked svg {
    fill: #ff4747;
    stroke: #ff4747;
    animation: pulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.interaction-btn.like-btn.liked,
.like-btn.liked {
    color: #ff4747 !important;
}

/* Ensure SVG path inherits fill */
.interaction-btn.like-btn.liked svg path,
.like-btn.liked svg path {
    fill: #ff4747;
}