/* ================================
   Waseet Platform - Main Stylesheet
   Minimal, Clean, RTL Arabic Design
   ================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ================================
   NAVBAR
   ================================ */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
    line-height: 1;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 15px;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-cta {
    background: var(--primary);
    color: var(--white) !important;
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--primary-dark);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--gray-700);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.mobile-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ================================
   HERO SECTION
   ================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--white);
}

/* ================================
   FEATURES
   ================================ */
.features {
    padding: 60px 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.section-title p {
    color: var(--gray-500);
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.feature-card p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ================================
   MERCHANTS SECTION
   ================================ */
.merchants-section {
    padding: 60px 0;
}

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

.merchant-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.merchant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.merchant-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    position: relative;
}

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

.merchant-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--white);
    object-fit: cover;
    position: absolute;
    bottom: -40px;
    right: 20px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.merchant-info {
    padding: 52px 20px 20px;
}

.merchant-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-900);
}

.merchant-desc {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.merchant-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ================================
   MERCHANT PAGE
   ================================ */
.merchant-header {
    position: relative;
    margin-bottom: 60px;
}

.merchant-header-cover {
    height: 250px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.merchant-header-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merchant-header-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.merchant-header-info {
    position: relative;
    margin-top: -60px;
    padding: 0 20px;
}

.merchant-header-inner {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.merchant-header-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: var(--shadow);
    background: var(--gray-100);
}

.merchant-header-details {
    flex: 1;
    min-width: 200px;
}

.merchant-header-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.merchant-header-desc {
    color: var(--gray-500);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 500px;
}

.merchant-contact-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.contact-btn-whatsapp {
    background: #25d366;
    color: white;
}

.contact-btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.contact-btn-telegram {
    background: #0088cc;
    color: white;
}

.contact-btn-telegram:hover {
    background: #006699;
    transform: translateY(-2px);
}

.contact-btn-phone {
    background: var(--gray-800);
    color: white;
}

.contact-btn-phone:hover {
    background: var(--gray-900);
    transform: translateY(-2px);
}

/* ================================
   PRODUCTS GRID
   ================================ */
.products-section {
    padding: 0 0 60px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

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

.product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-info {
    padding: 16px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ================================
   PRODUCT DETAIL PAGE
   ================================ */
.product-detail {
    padding: 40px 0 60px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-detail-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-100);
    aspect-ratio: 1;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
}

.product-detail-desc {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 24px;
    font-size: 1rem;
}

.order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.order-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.order-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.order-btn-whatsapp {
    background: #25d366;
}

.order-btn-whatsapp:hover {
    background: #128c7e;
}

.order-btn-telegram {
    background: #0088cc;
}

.order-btn-telegram:hover {
    background: #006699;
}

.order-btn-phone {
    background: var(--gray-800);
}

.order-btn-phone:hover {
    background: var(--gray-900);
}

.product-merchant-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.product-merchant-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ================================
   ADMIN / DASHBOARD
   ================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: var(--white);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--gray-800);
    margin-bottom: 16px;
}

.admin-sidebar .logo-text {
    color: var(--white);
}

.admin-menu {
    list-style: none;
    padding: 0;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.admin-menu li a:hover,
.admin-menu li.active a {
    color: var(--white);
    background: var(--gray-800);
}

.admin-main {
    flex: 1;
    margin-right: 260px;
    padding: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 24px;
}

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

.admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.admin-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
    background: var(--white);
}

.admin-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.admin-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: var(--gray-50);
}

.admin-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #059669;
}

/* ================================
   LOGIN PAGE
   ================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--gray-100) 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-box .logo {
    justify-content: center;
    margin-bottom: 8px;
}

.login-box .logo-text {
    font-size: 28px;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 28px;
    font-size: 15px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--primary-dark);
}

/* ================================
   FOOTER
   ================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    margin-top: 8px;
    line-height: 1.6;
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    color: var(--gray-400);
    text-decoration: none;
    padding: 6px 0;
    transition: var(--transition);
}

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

.footer-contact p {
    padding: 6px 0;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ================================
   MESSAGES & ALERTS
   ================================ */
.message {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ================================
   EMPTY STATE
   ================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu.active {
        display: flex;
    }
    
    .merchant-header-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .merchant-header-avatar {
        margin: 0 auto;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .admin-main {
        margin-right: 0;
    }
    
    .admin-layout {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero {
        padding: 60px 0 80px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .products-grid,
    .merchants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
    
    .login-box {
        padding: 24px;
    }
}

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

.fade-in {
    animation: fadeInUp 0.5s ease-out;
}
