/* =====================================================
   CORE AZANIA - UNIFIED STYLESHEET
   Used across: Homepage, Shop, Login, Signup, Account, Shipping
   ===================================================== */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f8;
    color: #333;
}

/* ===== HEADER ===== 
   Used on: All Pages */
.header {
    background-color: #dfe6ed;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.Logo {
    flex-shrink: 0;
}

.Logo img {
    width: 70px;
    height: auto;
    cursor: pointer;
    object-fit: contain;
}

.header a, .header div {
    color: black;
    text-decoration: none;
    padding: 8px 15px;
    transition: all 0.2s ease;
    font-size: 16px;
    white-space: nowrap;
}

.header a:hover, .header div:hover {
    transform: scale(1.05);
    color: #007aff;
}

/* Cart Container */
.cart-container, .Cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 5px;
    cursor: pointer;
}

.cart-counter {
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    padding: 3px 7px;
    font-size: 0.75rem;
    font-weight: bold;
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* ===== LOGO + SIGNUP ROW (Login/Signup Pages) ===== */
.logo-signup-row {
    display: none; /* Removed - signup now inside login container */
}

.signup-section {
    display: none; /* Removed - signup now inside login container */
}

.signup-button {
    background-color: cornflowerblue;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.signup-button:hover {
    background-color: #3a6fcf;
}

/* ===== LOGIN CONTAINER ===== 
   Used on: login.php */
.login-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.login-container label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

.login-container button {
    margin-top: 25px;
    width: 100%;
    padding: 12px;
    background-color: cornflowerblue;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.login-container button:hover {
    background-color: #3a6fcf;
}

/* Signup Prompt inside Login Container */
.signup-prompt {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.signup-prompt span {
    color: #666;
    font-size: 14px;
}

.signup-link {
    background-color: cornflowerblue;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.signup-link:hover {
    background-color: #3a6fcf;
    color: white;
}

/* ===== SIGNUP CONTAINER ===== 
   Used on: signup.php */
.signup-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
}

.signup-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.signup-container label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
}

.signup-container input,
.signup-container textarea {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

.signup-container button {
    margin-top: 25px;
    width: 100%;
    padding: 12px;
    background-color: cornflowerblue;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.signup-container button:hover {
    background-color: #3a6fcf;
}

/* ===== ERROR & MESSAGE STYLES ===== 
   Used on: login.php, signup.php */
.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}

.message {
    margin-top: 20px;
    text-align: center;
    color: #155724;
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
}

/* ===== HOMEPAGE SECTIONS ===== 
   Used on: index.html */
.slider {
    background-color: #dfe6ed;
    margin: 20px auto;
    padding: 40px 20px;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    font-size: 28px;
    font-weight: bold;
}

.service1 {
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px auto;
    padding: 30px;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 24px;
}

.service1 strong {
    flex: 1;
}

.service1 img {
    max-width: 35%;
    border-radius: 8px;
}

.service3-link {
    text-decoration: none;
    display: block;
}

.service3-link:hover {
    cursor: pointer;
}

.service3 {
    background-color: #e3eaf2;
    margin: 20px auto;
    padding: 25px;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 24px;
    text-align: center;
    font-weight: bold;
    color: #000;
}

.service4 {
    background-color: #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px auto;
    padding: 30px;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.graph-image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
}

.text-content {
    flex: 1;
}

.heading-title {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.why-list {
    font-size: 18px;
    line-height: 1.8;
    padding-left: 20px;
}

/* ===== SHOP PAGE ===== 
   Used on: shop.html */
.shop-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.shop-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: bold;
}

/* Filters */
.filters {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #007aff;
    margin-bottom: 10px;
}

.product-condition {
    background: #e8f5e8;
    color: #2d5016;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 15px;
}

.product-condition.used {
    background: #fff3cd;
    color: #856404;
}

.product-condition.refurbished {
    background: #d1ecf1;
    color: #0c5460;
}

.product-specs {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.add-to-cart {
    width: 100%;
    background: #007aff;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart:hover {
    background: #0056cc;
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.stock-badge.low {
    background: #ffc107;
    color: #000;
}

.stock-badge.out {
    background: #dc3545;
}

/* ===== FOOTER ===== 
   Used on: All Pages */
.footer {
    background-color: #dfe6ed;
    color: black;
    padding: 30px 10px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    margin-top: 50px;
}

.footer-link {
    color: black;
    text-decoration: none;
    margin: 5px 10px;
    padding: 5px 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-link:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.footer-link img {
    vertical-align: middle;
}

.copyright {
    font-weight: bold;
    margin: 5px 10px;
}

/* ===== CHECKOUT & ACCOUNT SHARED STYLES ===== 
   Used on: checkout.html, account.html */
.checkbox-label {
    color: #666;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: '.'; }
    34%, 66% { content: '..'; }
    67%, 100% { content: '...'; }
}

.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f5f5;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: auto;
}

.user-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.welcome-text {
    text-align: center;
    margin-bottom: 20px;
}

.profile-update {
    text-align: center;
}

.profile-update label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.profile-update input[type="file"] {
    margin-bottom: 10px;
}

.profile-update button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.profile-update button:hover {
    background-color: #357ab8;
}

/* ===== SHIPPING PAGE STYLES ===== 
   Used on: shipping.html */
.shipping-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.order-summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: fit-content;
    border: 2px solid #f0f0f0;
}

.summary-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
}

.order-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.item-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.item-quantity {
    font-size: 1rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

.item-specs {
    font-size: 1rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 15px;
}

.item-price {
    font-size: 1.2rem;
    color: #333;
    text-align: right;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    padding-top: 20px;
    border-top: 2px solid #007aff;
}

.summary-label {
    font-size: 1.1rem;
    color: #666;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.empty-cart-notice {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart-notice h3 {
    margin-bottom: 15px;
    color: #333;
}

.customer-details {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 20px 0;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.custom-checkbox.checked {
    background: #007aff;
    border-color: #007aff;
}

.custom-checkbox.checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: -2px;
    left: 2px;
}

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.address-full {
    grid-column: 1 / -1;
}

.continue-section {
    margin-top: 40px;
    text-align: right;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: #333;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: #ff3b30;
}

.optional {
    color: #999;
    font-weight: normal;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: #007aff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-input::placeholder {
    color: #999;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ===== RESPONSIVE DESIGN ===== 
   Mobile optimizations for all pages */
@media (max-width: 768px) {
    /* Header - Mobile */
    .header {
        justify-content: center;
        padding: 10px 15px;
        gap: 10px;
    }

    .Logo {
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .Logo img {
        width: 60px;
    }

    .header a, .header div {
        font-size: 14px;
        padding: 6px 10px;
    }

    .cart-container, .Cart {
        position: relative;
        padding: 6px 10px;
    }

    /* Logo Signup Row - Mobile */
    .logo-signup-row {
        display: none; /* Hidden on all screen sizes */
    }

    .signup-section {
        display: none; /* Hidden on all screen sizes */
    }

    .signup-prompt {
        flex-direction: row;
        gap: 8px;
    }

    .signup-prompt span {
        font-size: 13px;
    }

    .signup-link {
        padding: 10px 24px;
        font-size: 14px;
    }

    /* Login Container - Mobile */
    .login-container {
        padding: 25px 20px;
        margin: 20px 15px;
        max-width: 100%;
    }

    .login-container h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .login-container label {
        font-size: 13px;
        margin-top: 12px;
    }

    .login-container input {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .login-container button {
        padding: 14px;
        margin-top: 20px;
        font-size: 16px;
    }

    /* Signup Container - Mobile */
    .signup-container {
        padding: 25px 20px;
        margin: 20px 15px;
        max-width: 100%;
    }

    .signup-container h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .signup-container label {
        font-size: 13px;
        margin-top: 12px;
    }

    .signup-container input,
    .signup-container textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .signup-container button {
        padding: 14px;
        margin-top: 20px;
        font-size: 16px;
    }

    /* Homepage - Mobile */
    .slider {
        font-size: 20px;
        padding: 25px 15px;
        margin: 15px 10px;
    }

    .service1 {
        flex-direction: column;
        text-align: center;
        font-size: 18px;
        padding: 20px;
        margin: 15px 10px;
    }

    .service1 img {
        max-width: 80%;
        margin-top: 20px;
    }

    .service3 {
        font-size: 20px;
        padding: 20px;
        margin: 15px 10px;
    }

    .service4 {
        flex-direction: column;
        padding: 20px;
        margin: 15px 10px;
    }

    .graph-image {
        max-width: 100%;
    }

    .heading-title {
        font-size: 24px;
    }

    .why-list {
        font-size: 16px;
    }

    /* Shop - Mobile */
    .shop-title {
        font-size: 2rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .filter-group {
        width: 100%;
        min-width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-image {
        height: 200px;
        font-size: 2.5rem;
    }

    /* Footer - Mobile */
    .footer {
        justify-content: center;
        text-align: center;
        gap: 10px;
        padding: 20px 10px;
    }

    .footer-link {
        font-size: 14px;
        margin: 5px;
    }

    .footer-link img {
        width: 20px !important;
    }

    .copyright {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
}
