/*==================================================
  MODERN CSS RESET & BASE STYLES
==================================================*/
:root {
    /* Color Palette */
    --primary-color: #3B82F6; /* Blue 500 */
    --primary-hover: #2563EB; /* Blue 600 */
    --secondary-color: #10B981; /* Emerald 500 */
    --text-primary: #1F2937; /* Gray 800 */
    --text-secondary: #6B7280; /* Gray 500 */
    --background-light: #F9FAFB; /* Gray 50 */
    --background-white: #FFFFFF;
    --border-color: #E5E7EB; /* Gray 200 */
    --danger-color: #EF4444; /* Red 500 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --border-radius-sm: 0.375rem; /* 6px */
    --border-radius-md: 0.5rem; /* 8px */
    --border-radius-lg: 0.75rem; /* 12px */
    --border-radius-xl: 1rem; /* 16px */
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 80px; /* Space for fixed header */
    padding-bottom: 80px; /* Space for fixed bottom navbar */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/*==================================================
  LAYOUT & CONTAINER
==================================================*/
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/*==================================================
  TYPOGRAPHY
==================================================*/
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/*==================================================
  HEADER & NAVIGATION
==================================================*/
.main-header {
    background-color: var(--background-white);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.25rem 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: relative;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.main-nav {
    display: flex;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger i {
    font-size: 1.5rem;
    color: var(--text-primary);
}


/*==================================================
  BOTTOM NAVIGATION (MOBILE)
==================================================*/
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-white);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.08);
    display: none; /* Hidden by default, shown in media query */
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
}

.bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.bottom-nav .nav-link i {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.bottom-nav .nav-link.active,
.bottom-nav .nav-link:hover {
    color: var(--primary-color);
}

/*==================================================
  HERO SECTION
==================================================*/
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-white);
    text-align: center;
    padding: 6rem 1.5rem;
    margin-bottom: 4rem;
    border-radius: var(--border-radius-xl);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 650px;
    margin: 1rem auto 2rem;
    color: rgba(255, 255, 255, 0.9);
}

/*==================================================
  CARD STYLES (UNIFIED)
==================================================*/
.card {
    background-color: var(--background-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1.5rem; /* Unified padding */
}

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

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--border-radius-md); /* Rounded images */
    margin-bottom: 1.5rem;
}

.card-content {
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-description {
    margin-bottom: 1.5rem;
}

/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/*==================================================
  BUTTONS
==================================================*/
.btn {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-secondary {
    color: var(--text-primary);
    background-color: transparent;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--background-light);
    border-color: #D1D5DB; /* Gray 300 */
}

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

.btn-danger:hover {
    background-color: #d03030;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
}

/*==================================================
  FORMS & AUTH
==================================================*/
.auth-container, .form-container, .admin-controls, .product-form-container {
    max-width: 480px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.auth-container h2, .form-container h2 {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--background-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.form-links {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.form-links a {
    margin: 0 0.5rem;
}

/*==================================================
  PROFILE PAGE
==================================================*/
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.profile-card {
    padding: 1.5rem;
}

.profile-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--background-white);
    box-shadow: var(--shadow-md);
}

.profile-avatar .btn-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.profile-nav .nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.profile-nav .nav-btn:hover {
    background-color: var(--background-light);
}

.profile-nav .nav-btn.active {
    background-color: var(--primary-color);
    color: var(--background-white);
    box-shadow: var(--shadow-sm);
}

.profile-nav .nav-btn i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.profile-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

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

.profile-content .content-section {
    display: none;
}

.profile-content .content-section.active {
    display: block;
}

.info-group {
    margin-bottom: 1.5rem;
}
.info-group label {
    font-weight: 600;
    color: var(--text-secondary);
}
.info-group p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary-color), #60A5FA);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
}


/*==================================================
  RESPONSIVE DESIGN
==================================================*/
@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--background-white);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0;
    }
    
    .main-nav.active {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav li {
        width: 100%;
    }

    .main-nav a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    .hamburger {
        display: block;
    }

    .bottom-nav {
        display: flex;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }

    .auth-container {
        margin: 2rem auto;
        box-shadow: none;
        border-radius: 0;
    }
}
