/* Main Styles for Glowon.ro - Professional Design */
/* Version: 1.0.0 - Updated: 2024-10-22 */

:root {
    /* Glowon.com.tr Color Palette - Verde Natural și Alb */
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #81C784;
    --secondary-color: #2E7D32;
    --accent-color: #FF5722;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --info-color: #2196F3;
    --light-color: #F1F8E9;
    --dark-color: #1B5E20;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #F1F8E9;
    --gray-200: #C8E6C9;
    --gray-300: #A5D6A7;
    --gray-400: #81C784;
    --gray-500: #66BB6A;
    --gray-600: #4CAF50;
    --gray-700: #388E3C;
    --gray-800: #2E7D32;
    --gray-900: #1B5E20;
    --green-gradient: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    --fresh-gradient: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    margin: 0;
    padding: 0;
}

/* Logo Styles - Compact */
.logo-img {
    height: 35px;
    width: auto;
    max-width: 150px;
    transition: transform 0.2s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-700);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-50);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Hero Section */
.hero-section {
    background: var(--green-gradient);
    color: var(--white);
    padding: 6rem 0;
    margin-bottom: 0;
    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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23d4af37" opacity="0.2"/><circle cx="75" cy="75" r="1" fill="%23d4af37" opacity="0.2"/><circle cx="50" cy="10" r="0.5" fill="%23d4af37" opacity="0.3"/><circle cx="10" cy="60" r="0.5" fill="%23d4af37" opacity="0.3"/><circle cx="90" cy="40" r="0.5" fill="%23d4af37" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.4;
}

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

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    font-weight: 500;
    color: var(--white);
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Product Badges */
.product-badge {
    position: absolute;
    z-index: 5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
}

.product-badge.stock-out {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    top: 10px;
    left: 10px;
}

.product-badge.stock-low {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
    top: 10px;
    left: 10px;
}

.product-badge.discount {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    top: 10px;
    right: 10px;
    animation: pulse 2s infinite;
}

.product-badge.featured {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    bottom: 10px;
    left: 10px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Product Price Styles */
.product-price-original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

.product-price-sale {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Stock Status Button */
.btn-stock-out {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.product-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.product-card .btn {
    position: relative;
    z-index: 15;
    pointer-events: auto;
    cursor: pointer;
}

.product-card a[href*="product.php"] {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.product-card a[href*="product.php"]:hover {
    color: inherit;
    text-decoration: none;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.product-card .card-text {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

/* Featured Products Section */
.featured-products {
    padding: 80px 0;
    background: var(--white);
}

.featured-products h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 3rem;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--gray-100);
}

.feature-icon {
    margin-bottom: 1.5rem;
}

.feature-icon i {
    color: var(--primary-color);
}

.features-section h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.features-section p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: var(--dark-color) !important;
    color: var(--white);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green-gradient);
}

.footer h5, .footer h6 {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: 0.75rem;
}

.footer a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
}

.footer a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-800);
    color: var(--white);
    transition: all 0.2s ease;
    text-decoration: none;
}

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

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-800);
    color: var(--white);
    padding: 15px 0;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
    font-weight: 600;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--gray-300);
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    background: var(--white);
    overflow: hidden;
}

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

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

/* Featured Products Section */
.featured-products {
    padding: 6rem 0;
    background: var(--white);
    position: relative;
}

.featured-products::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green-gradient);
}

.featured-products h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.featured-products h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    background: var(--gray-50);
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--fresh-gradient);
}

.feature-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.feature-icon i {
    color: var(--primary-color);
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.features-section h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
    text-align: center;
}

.features-section p {
    color: var(--gray-600);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

/* Search */
.search-form {
    position: relative;
}

.search-form .form-control {
    padding-right: 3rem;
}

.search-form .btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
}

/* Cart */
.cart-item {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-summary {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1.5rem;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    border: none;
    color: var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

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

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead th {
    background: var(--gray-100);
    border: none;
    font-weight: 600;
    color: var(--gray-800);
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Admin Panel */
.admin-sidebar {
    background: var(--gray-800);
    min-height: 100vh;
    padding: 0;
}

.admin-sidebar .nav-link {
    color: var(--gray-300);
    padding: 1rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--primary-color);
    color: var(--white);
}

.admin-content {
    padding: 2rem;
    background: var(--gray-100);
    min-height: 100vh;
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important; }

.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 1rem !important; }

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* FASE 2: SEO & Performance Optimizations */

/* Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Performance Optimizations */
.lazy-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Critical CSS - Above the fold */
.hero-section {
    will-change: transform;
}

.navbar {
    will-change: transform;
}

/* Preload critical images */
.logo-img {
    content-visibility: auto;
    height: 35px;
    max-width: 150px;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Performance hints */
.product-card {
    contain: layout style paint;
}

/* Reduce layout shifts */
.aspect-ratio {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* FASE 7: Final Optimizations */

/* Critical CSS - Above the fold optimization */
.hero-section {
    contain: layout style paint;
    will-change: transform;
}

.navbar {
    contain: layout style paint;
    will-change: transform;
}

/* Performance optimizations */
.product-card {
    contain: layout style paint;
    transform: translateZ(0);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .cookie-consent-banner {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid;
    }
    
    .card {
        border: 2px solid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #1a1a1a;
        --bs-body-color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .navbar-light {
        background-color: #2d2d2d !important;
    }
}

/* User Dropdown Fix - NORMAL BOOTSTRAP */
.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    min-width: 200px !important;
    background: white !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    margin-top: 5px !important;
    display: none !important;
}

.navbar .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Force dropdown items to be visible */
.navbar .dropdown-item {
    padding: 10px 20px !important;
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    background: white !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.navbar .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #4CAF50 !important;
}

.navbar .dropdown-divider {
    margin: 8px 0 !important;
    border-top: 1px solid #e9ecef !important;
}

/* Ensure sections don't interfere with dropdown */
.hero-section,
.featured-products,
.products-section,
.about-section,
.contact-section,
.footer {
    position: relative !important;
    z-index: 1 !important;
}

/* Force dropdown items to be visible */
.navbar .dropdown-item {
    padding: 10px 20px !important;
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    background: white !important;
    border: none !important;
    z-index: 999999 !important;
    position: relative !important;
}

.navbar .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #4CAF50 !important;
}

.navbar .dropdown-divider {
    margin: 8px 0 !important;
    border-top: 1px solid #e9ecef !important;
    z-index: 999999 !important;
    position: relative !important;
}

.navbar .dropdown-item {
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.navbar .dropdown-item i {
    width: 16px;
    text-align: center;
}

.navbar .dropdown-divider {
    margin: 8px 0;
    border-top: 1px solid #e9ecef;
}

/* Ensure dropdown is above everything */
.navbar {
    position: relative;
    z-index: 1000;
}

.navbar .nav-item.dropdown {
    position: relative;
}

/* Fix for mobile dropdown */
@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0 !important;
        background-color: #f8f9fa;
        border: none;
        box-shadow: none;
    }
}
