/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
    /* Fakir Original Light Colors */
    --black:          #f0f4f8; /* background */
    --deep:           #ffffff;
    --dark:           #e2e8f0;
    --surface:        #ffffff;
    --card:           rgba(255, 255, 255, 0.98);
    --card-hover:     #f8fafc;
    --elevated:       #ffffff;

    /* Brand */
    --orange:         #6489C6; /* Fakir Blue */
    --orange-bright:  #81a0d8;
    --orange-dim:     #5171a8;
    --orange-soft:    rgba(100, 137, 198, 0.12);
    --orange-glow:    rgba(100, 137, 198, 0.20);
    --orange-halo:    rgba(100, 137, 198, 0.06);

    /* Text */
    --white:          #111111; /* Primary Text mapped from TEKNO white */
    --text-primary:   #222222;
    --text-secondary: #555555;
    --text-dim:       #8D8F92;
    --muted:          #8D8F92;

    /* Semantic */
    --success:        #166534;
    --success-bg:     #dcfce7;
    --danger:         #991b1b;
    --danger-bg:      #fee2e2;

    /* Borders */
    --border:         #e0e0e0;
    --border-hover:   rgba(100, 137, 198, 0.35);

    /* Radius */
    --r-xs:  6px;
    --r-sm:  10px;
    --r-md:  16px;
    --r-lg:  24px;
    --r-xl:  36px;

    /* Shadows for Light UI */
    --shadow-xs:        0 1px 4px rgba(0,0,0,0.05);
    --shadow-sm:        0 2px 12px rgba(0,0,0,0.06);
    --shadow-md:        0 6px 28px rgba(0,0,0,0.08);
    --shadow-lg:        0 12px 48px rgba(0,0,0,0.10);
    --shadow-xl:        0 24px 80px rgba(0,0,0,0.12);
    --shadow-orange:    0 8px 30px rgba(100,137,198,0.20);
    --glow-orange:      0 0 40px rgba(100,137,198,0.12);

    --font: 'Cairo', sans-serif;
    --display: 'Cairo', sans-serif;
    --mono: 'Space Grotesk', sans-serif;

    --transition: 0.22s cubic-bezier(0.4, 0.0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --max-w: 1280px;
}

@font-face {
    font-family: 'Doran';
    src: url('../fonts/Doran-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

[lang="ku"] { font-family: 'Doran', sans-serif !important; }
[lang="ku"] body, [lang="ku"] p, [lang="ku"] h1, [lang="ku"] h2, [lang="ku"] h3,
[lang="ku"] a, [lang="ku"] button, [lang="ku"] input, [lang="ku"] textarea, [lang="ku"] span, [lang="ku"] div {
    font-family: 'Doran', sans-serif !important;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font);
    background-color: var(--black);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    direction: rtl;
}

a { text-decoration: none; color: var(--orange); transition: color var(--transition); }
a:hover { color: var(--orange-bright); }
img { display: block; max-width: 100%; }

/* Header */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding: 0.8rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    position: sticky; top: 0; z-index: 1000;
}
.logo a {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--white);
    display: flex; align-items: center; gap: 0.5rem;
}
.brand-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dim));
    color: #fff;
    border-radius: var(--r-sm); font-size: 0.9rem;
    box-shadow: var(--shadow-orange); transition: 0.35s var(--spring);
}
.brand-name {
    color: var(--orange);
}
.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s var(--spring);
}
.brand-logo:hover {
    transform: scale(1.05);
}

.lang-switcher {
    display: flex; gap: 0.2rem; padding: 0.25rem;
    background: var(--black); border: 1px solid var(--border); border-radius: var(--r-md);
}
.lang-switcher a {
    color: var(--muted); font-size: 0.85rem; font-weight: 600;
    padding: 0.3rem 0.65rem; border-radius: var(--r-sm); transition: all var(--transition);
}
.lang-switcher a:hover, .lang-switcher a.active { color: #fff; background: var(--orange); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dim) 100%);
    color: #fff; padding: 0.6rem 1.35rem; border-radius: var(--r-sm);
    border: none; cursor: pointer; font-weight: 700; font-size: 0.875rem; font-family: var(--font);
    transition: all 0.28s var(--spring); box-shadow: 0 2px 12px rgba(100,137,198,0.22);
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 28px rgba(100,137,198,0.40); color: white; }
.btn-primary { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dim) 100%); color: white; border: none; }
.btn-danger { background: rgba(153, 27, 27, 0.1); color: var(--danger); border: 1px solid rgba(153, 27, 27, 0.3); box-shadow: none; }
.btn-danger:hover { background: rgba(153, 27, 27, 0.2); color: var(--danger); box-shadow: none; }

/* Dashboard / Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 2rem; }
.admin-card {
    background: var(--card); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--r-lg);
    padding: 2.75rem; margin-bottom: 2rem; box-shadow: var(--shadow-sm);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}
.admin-card h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 800; color: var(--white); margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }

/* Forms */
.form-group { margin-bottom: 1.4rem; padding: 0.5rem 0; text-align: right; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--muted); }
.form-control {
    width: 100%; padding: 0.8rem 1.1rem; background: rgba(255,255,255,0.7); border: 1px solid var(--border);
    border-radius: var(--r-sm); color: var(--text-primary); font-family: var(--font); font-size: 0.95rem;
    transition: all var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft), inset 0 2px 4px rgba(0,0,0,0.01); background: #ffffff; }

/* Tables */
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: right; }
.admin-table th, .admin-table td { padding: 1rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-size: 0.85rem; font-family: var(--mono); text-transform: uppercase; }

/* Login */
.login-container {
    max-width: 440px; margin: 5rem auto; background: var(--card); border: 1px solid var(--border);
    padding: 3rem; border-radius: var(--r-xl); box-shadow: var(--shadow-md), var(--glow-orange);
    text-align: center;
}
.login-container h2 { font-size: 1.5rem; color: var(--orange); margin-bottom: 1.5rem; font-weight: 800; }
.login-container h2 span { color: var(--white); }

/* Product Grid */
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem; margin-top: 1rem;
}
.product-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
    transition: all 0.32s; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
}
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md), var(--shadow-orange); }

.card-img-wrapper { position: relative; background: var(--black); padding: 15px; display: flex; align-items: center; justify-content: center; height: 160px; }
.product-card img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.5s; mix-blend-mode: multiply; }
.product-card:hover img { transform: scale(1.06); }

.card-body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { font-family: var(--display); font-size: 1.1rem; color: var(--text-primary); margin-bottom: 0.5rem; font-weight: 600; text-align: right; }
.product-card p.price { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--orange); margin-top: auto; text-align: right; direction: ltr; }

/* Cart Item / List Product (Stock Page) */
.cart-item {
    display: flex; align-items: center; gap: 1rem; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1rem 1.1rem; margin-bottom: 0.85rem; transition: border-color 0.22s;
    box-shadow: var(--shadow-xs);
}
.cart-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.cart-item-img {
    width: 68px; height: 68px; flex-shrink: 0; border-radius: var(--r-sm); overflow: hidden;
    background: var(--black); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 4px;
}
.cart-item-img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.cart-item-price { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

/* Badges */
.status-badge {
    display: inline-flex; align-items: center; padding: 0.3rem 0.7rem; border-radius: var(--r-xs);
    font-size: 0.75rem; font-weight: 600; font-family: var(--font); color: #fff;
}
.status-available { background: var(--success); }
.status-unavailable { background: var(--muted); }
.success { background: var(--success); color: white; }
.danger { background: var(--muted); color: white; }

/* Alerts */
.alert { padding: 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; border: 1px solid; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(153, 27, 27, 0.2); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(22, 101, 52, 0.2); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; background: var(--card); border-radius: var(--r-md); border: 1px dashed var(--border); }
.empty-icon { font-size: 2rem; margin-bottom: 1rem; }

/* Helper classes added for compatibility */
.product-thumb { width: 46px; height: 46px; object-fit: contain; }

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Responsive adjustments */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 0.8rem; padding: 1rem; align-items: stretch; text-align: center; }
    .logo a { justify-content: center; }
    
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
    .product-card h3 { font-size: 1rem; }
    .product-card p.price { font-size: 1.1rem; }
    .card-img-wrapper { height: 130px; }
    
    .admin-card { padding: 1.25rem; margin-bottom: 1.25rem; }
    .container { padding: 1rem; }
    .login-container { margin: 2rem auto; padding: 1.5rem; }
    
    .grid-2-col { grid-template-columns: 1fr; }
    
    .cart-item { flex-direction: column; align-items: stretch; text-align: right; }
    .cart-item-img { align-self: center; margin-bottom: 0.5rem; width: 80px; height: 80px; }
    .cart-item form { justify-content: center; margin-top: 0.5rem; }
}
