@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

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

:root {
    --primary: #ff3b3f;
    --secondary: #00d4ff;
    --accent: #ffd700;
    --dark-bg: #0a0e27;
    --dark-card: #151932;
    --dark-light: #1e2442;
    --text-light: #e8eaed;
    --text-dim: #9ba3b4;
    --success: #00ff88;
    --danger: #ff3366;
    --shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
    --glow-primary: 0 0 20px rgba(255, 59, 63, 0.5);
    --glow-secondary: 0 0 20px rgba(0, 212, 255, 0.5);
}

body, input, button, select, textarea, * {
    font-family: 'Vazir', sans-serif !important;
}

body {
    background: linear-gradient(135deg, #0a0e27 0%, #1a0b2e 50%, #16213e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-light);
    line-height: 1.8;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 59, 63, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.navbar {
    background: rgba(21, 25, 50, 0.85);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(255, 59, 63, 0.2);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: -1px;
    filter: drop-shadow(0 0 10px rgba(255, 59, 63, 0.5));
}

.logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 20px rgba(255, 59, 63, 0.8));
}

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

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--primary), var(--danger));
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    box-shadow: 0 0 15px rgba(255, 59, 63, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff6b6e 100%);
    color: white;
    box-shadow: var(--glow-primary);
    border: 1px solid rgba(255, 59, 63, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 59, 63, 0.8);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--dark-light) 0%, var(--dark-card) 100%);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    box-shadow: var(--glow-secondary);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, #00b8d4 100%);
    color: var(--dark-bg);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ff1744 100%);
    color: white;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.9);
}

.btn-lg {
    padding: 1.2rem 3.5rem;
    font-size: 1.3rem;
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.hero {
    text-align: center;
    padding: 5rem 0 3rem;
    color: white;
    animation: fadeIn 0.8s ease-in;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 59, 63, 0.3));
}

.hero p {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-dim);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
    padding: 3rem 0;
}

.product-card {
    background: var(--dark-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 59, 63, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.6s ease-out;
}

.product-card:hover {
    transform: translateY(-20px) scale(1.02);
    box-shadow: 0 20px 60px rgba(255, 59, 63, 0.4);
    border-color: rgba(255, 59, 63, 0.5);
}

.product-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e2442 0%, #2d3561 100%);
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 39, 0.6) 100%);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.15) rotate(2deg);
}

.product-info {
    padding: 2rem;
}

.product-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.product-info p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.price {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-box {
    background: var(--dark-card);
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 212, 255, 0.2);
    width: 100%;
    max-width: 500px;
    animation: scaleIn 0.5s ease-out;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 1.2rem;
    background: var(--dark-light);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: var(--glow-secondary);
    background: rgba(0, 212, 255, 0.05);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

.form-actions button {
    flex: 1;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 2rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.alert {
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 700;
    animation: slideDown 0.4s ease-out;
    text-align: center;
    border: 2px solid;
}

.alert-error {
    background: rgba(255, 51, 102, 0.15);
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.alert-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.cart-items {
    background: var(--dark-card);
    border-radius: 24px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 59, 63, 0.1);
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid rgba(255, 59, 63, 0.1);
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: rgba(255, 59, 63, 0.05);
    border-radius: 16px;
}

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

.cart-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 212, 255, 0.2);
}

.item-details h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 800;
}

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

.quantity-box input {
    width: 70px;
    padding: 0.6rem;
    background: var(--dark-light);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--secondary);
    transition: all 0.3s ease;
}

.quantity-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: var(--glow-secondary);
    background: rgba(0, 212, 255, 0.1);
}

.item-total {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    min-width: 140px;
    text-align: left;
    transition: all 0.3s ease;
}

.cart-summary {
    background: var(--dark-card);
    border-radius: 24px;
    padding: 3.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.cart-summary h3 {
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-cart {
    background: var(--dark-card);
    border-radius: 24px;
    padding: 6rem 2rem;
    text-align: center;
    margin: 3rem 0;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 59, 63, 0.2);
}

.empty-cart p {
    font-size: 1.6rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
}

.result-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.result-box {
    background: var(--dark-card);
    padding: 4.5rem 3.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    animation: scaleIn 0.6s ease-out;
    border: 2px solid;
}

.result-box h2 {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    font-weight: 900;
}

.result-box p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    color: var(--text-dim);
    line-height: 2;
}

.result-box.success {
    border-color: var(--success);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
}

.result-box.success h2 {
    color: var(--success);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.result-box.error {
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(255, 51, 102, 0.3);
}

.result-box.error h2 {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    margin-top: 6rem;
    font-size: 1rem;
    border-top: 1px solid rgba(255, 59, 63, 0.1);
}

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

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .hero h2 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .products-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .cart-item {
        grid-template-columns: 90px 1fr;
        gap: 1rem;
    }
    .item-actions {
        grid-column: 1 / -1;
        justify-content: center;
    }
    .item-total {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 1rem;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
    }
    .product-footer {
        flex-direction: column;
    }
    .product-footer form, .product-footer .btn {
        width: 100%;
    }
    .form-actions {
        flex-direction: column;
    }
    .auth-box { padding: 2.5rem; }
    .result-box { padding: 3.5rem 2.5rem; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.6rem; }
    .btn { padding: 0.7rem 1.5rem; font-size: 0.95rem; }
    .cart-item img { width: 90px; height: 90px; }
}

html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
}
