/* ===========================
   RESET & VARIABLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --light-bg: #fff;
    --card-bg: #fff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================
   NAVIGATION
   =========================== */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1.2rem 0;
    gap: 2rem;
    position: relative;
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.logo-text {
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, transparent 0%, transparent 100%);
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
    z-index: -1;
}

.nav-links a:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-links a:hover::before {
    left: 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.btn-search,
.btn-cart {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
    position: relative;
}

.btn-search:hover,
.btn-cart:hover {
    color: var(--primary-color);
}

.btn-login,
.btn-dashboard {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-login:hover,
.btn-dashboard:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-count {
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* ===========================
   USER MENU
   =========================== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown {
    position: relative;
}

.btn-user {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-user:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.5rem 0;
    margin-top: 0.75rem;
    display: none;
    z-index: 1000;
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    text-align: left;
    color: var(--text-primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-family: inherit;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    color: var(--danger-color);
    font-weight: 600;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* ===========================
   MODAL
   =========================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease;
    margin: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ===========================
   MODAL TABS
   =========================== */
.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    flex: 1;
    text-align: center;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ===========================
   FORM STYLES
   =========================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.tab-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-remember input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.form-remember label {
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.btn-full {
    width: 100%;
    padding: 0.75rem;
}

.form-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    cursor: pointer;
}

.form-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--light-bg);
    transform: translateY(-2px);
}

.btn-light {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-light:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    background-color: var(--dark-bg);
    color: #cbd5e1;
    padding: 3rem 0 1rem;
    
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #f1f5f9;
    font-weight: 700;
}

.footer-section p {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* ===========================
   UTILITIES
   =========================== */
.text-center {
    text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-4 { padding-top: 1.5rem; }
.pb-4 { padding-bottom: 1.5rem; }

/* ===========================
   RESPONSIVE - Tablet
   =========================== */
@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }
}

/* ===========================
   RESPONSIVE - Mobile (768px)
   =========================== */
@media (max-width: 768px) {
    .navbar-content {
        padding: 1rem 0;
        gap: 1rem;
    }

    .navbar-brand a {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .navbar-actions {
        gap: 0.75rem;
    }

    .btn-login,
    .btn-dashboard {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn-search,
    .btn-cart {
        font-size: 1rem;
        padding: 0.25rem;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-tabs {
        margin-bottom: 1.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .tab-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        right: -50%;
        left: auto;
    }

    .footer-content {
        gap: 1.5rem;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }
}

/* ===========================
   RESPONSIVE - Small Mobile (480px)
   =========================== */
@media (max-width: 480px) {
    .navbar-content {
        flex-wrap: nowrap;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .navbar-brand a {
        font-size: 1rem;
        gap: 0.3rem;
        min-width: fit-content;
        flex-shrink: 0;
    }

    .logo-icon {
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    .logo-text {
        display: none;
    }

    .navbar-actions {
        gap: 0.25rem;
        margin-left: auto;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .btn-search {
        font-size: 0.9rem;
        padding: 0.2rem;
    }

    .btn-cart {
        font-size: 0.9rem;
        padding: 0.2rem;
    }

    .btn-login {
        padding: 0.35rem 0.6rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }

    .user-menu {
        flex-direction: row;
        gap: 0.25rem;
        align-items: center;
    }

    .btn-user {
        padding: 0.35rem 0.4rem;
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .modal {
        padding: 10px 0;
    }

    .modal.active {
        padding-top: 10px;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 0.75rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 1.2rem;
    }

    .modal-tabs {
        flex-wrap: nowrap;
        margin-bottom: 1.25rem;
    }

    .tab-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.75rem;
        margin-bottom: -1px;
    }

    .tab-content h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .form-remember label {
        font-size: 0.85rem;
    }

    .form-link {
        margin-top: 1.25rem;
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .btn-small {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .dropdown-menu {
        position: fixed;
        right: 10px;
        left: 10px;
        top: auto;
        width: auto;
    }

    .footer {
        padding: 2rem 0 0.75rem;
    }

    .footer-content {
        gap: 1rem;
    }

    .footer-section h4 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.8rem;
    }

    .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.75rem;
    }
}

/* ===========================
   RESPONSIVE - Extra Small (360px)
   =========================== */
@media (max-width: 360px) {
    .navbar-brand a {
        font-size: 0.9rem;
    }

    .logo-icon {
        font-size: 1.1rem;
    }

    .btn-search,
    .btn-cart {
        font-size: 0.85rem;
    }

    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .tab-btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.7rem;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}