/* =============================================
   FRONTEND CSS FOR IFSHOP.STORE AFFILIATE PROGRAM
   Blue and White Color Scheme
   Responsive Design
   Modern UI Components
============================================= */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #4dabf7;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --border-radius: 10px;
    --border-radius-sm: 5px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
    font-size: 16px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== LAYOUT & CONTAINERS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-lg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
}

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

.nav a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
    transform: translateY(-2px);
}

.nav a.active {
    background: rgba(255,255,255,0.3);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background: var(--light-bg);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.card-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin: -2rem -2rem 1.5rem -2rem;
}

.card-title {
    margin-bottom: 0;
    color: var(--white);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

.btn:hover {
    background: var(--primary-dark);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-warning {
    background: var(--warning);
    color: var(--text-dark);
}

.btn-warning:hover {
    background: #e0a800;
    color: var(--text-dark);
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: var(--info);
}

.btn-info:hover {
    background: #138496;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== GRID SYSTEM ===== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: var(--danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: var(--info);
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--light-bg);
}

.table-striped tr:nth-child(even) {
    background: var(--light-bg);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--light-bg);
}

.product-content {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.product-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.stat-card p {
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success), #1e7e34);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning), #e0a800);
    color: var(--text-dark);
}

.stat-card.warning h3 {
    color: var(--text-dark);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info), #138496);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--text-dark);
}

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

.badge-info {
    background: var(--info);
    color: var(--white);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 40px;
    padding: 0.5rem;
    text-align: center;
}

.pagination .btn.active {
    background: var(--primary-dark);
    transform: none;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 3rem 0 2rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: none;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav a {
        display: block;
        text-align: center;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .btn {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-bg: #2d2d2d;
        --text-dark: #ffffff;
        --text-light: #cccccc;
        --border-color: #444444;
    }
    
    .card {
        background: #2d2d2d;
    }
    
    .form-control {
        background: #1a1a1a;
        color: #ffffff;
        border-color: #444444;
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}