/**
 * Fair E Digital Shop - Main Stylesheet
 * 
 * @package FairEDigitalShop
 * @version 1.0.0
 */

/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #007cba;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --gradient-primary: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    --gradient-secondary: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    
    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-monospace: 'Fira Code', Consolas, 'Liberation Mono', monospace;
    
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
    
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--dark-color);
}

/* ===== UTILITY CLASSES ===== */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-secondary {
    background: var(--gradient-secondary) !important;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-primary {
    transition: var(--transition);
}

.hover-primary:hover {
    color: var(--primary-color) !important;
}

.min-vh-50 {
    min-height: 50vh;
}

.min-vh-75 {
    min-height: 75vh;
}

/* ===== HEADER STYLES ===== */
.top-bar {
    font-size: 0.875rem;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius-lg);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="1000,100 1000,0 0,100"/></svg>');
    background-size: cover;
    background-position: bottom;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* ===== PRODUCT CARDS ===== */
.product-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

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

.product-card .card-img-top {
    transition: var(--transition);
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .price {
    font-size: 1.1rem;
}

.product-card .price .text-decoration-line-through {
    font-size: 0.9rem;
}

/* ===== MEMBERSHIP CARDS ===== */
.membership-card {
    transition: var(--transition);
    border-radius: var(--border-radius-lg);
}

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

.membership-card .price-section {
    padding: 1rem 0;
}

.membership-card .list-unstyled li {
    padding: 0.25rem 0;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

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

.btn-warning:hover {
    background: #e0a800;
    color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    box-shadow: var(--box-shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

.btn-floating:hover {
    transform: translateY(-2px);
}

/* ===== FORMS ===== */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
}

.input-group .form-control:focus {
    z-index: 3;
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    font-weight: 500;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    border-radius: var(--border-radius);
}

/* ===== RATING STARS ===== */
.product-rating {
    display: inline-flex;
    gap: 0.125rem;
}

.product-rating i {
    font-size: 0.875rem;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    margin: 0 0.125rem;
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== BREADCRUMBS ===== */
.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
}

/* ===== TABLES ===== */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(0, 124, 186, 0.05);
}

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius-lg);
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: rgba(0, 124, 186, 0.1);
    color: var(--primary-color);
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

footer .social-links a {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

footer .social-links a:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .membership-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

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

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

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .footer,
    .btn-floating,
    .alert {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Focus styles for better accessibility */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2d3748;
        --dark-color: #f7fafc;
    }
    
    body {
        background-color: #1a202c;
        color: var(--dark-color);
    }
    
    .bg-light {
        background-color: var(--light-color) !important;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    .card {
        background-color: var(--light-color);
        border-color: #4a5568;
    }
    
    .navbar-light {
        background-color: var(--light-color) !important;
    }
    
    .navbar-light .navbar-nav .nav-link {
        color: var(--dark-color);
    }
}