/* Custom Styles for G Saven Mobile Shop */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

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

/* Section Spacing */
section {
    padding: 80px 0;
}

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.section-title p {
    color: #666;
    font-size: 1.1rem;
}

/* Button Styles */
.btn {
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s;
}

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

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

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

/* Form Styles */
.form-control {
    border-radius: 10px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select {
    border-radius: 10px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
}

/* Badge Styles */
.badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

/* Table Styles */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #f0f0f0;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #444;
        color: #f0f0f0;
    }
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Slide In Animation */
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    /* Section Spacing */
    section {
        padding: 40px 0;
    }
    
    .section-title {
        margin-bottom: 30px;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .section-title p {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Forms */
    .form-control, .form-select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Tables */
    .table-responsive {
        border-radius: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 8px;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        max-height: 30px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    /* Product Cards */
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-card .product-image {
        height: 150px;
    }
    
    .product-card .product-name {
        font-size: 0.9rem;
    }
    
    .product-card .product-price {
        font-size: 1rem;
    }
    
    /* Hero Section */
    .hero-section .carousel-item {
        height: 250px;
    }
    
    .hero-section .carousel-caption {
        padding: 15px;
        border-radius: 10px;
    }
    
    .hero-section .carousel-caption h2 {
        font-size: 1.2rem;
    }
    
    .hero-section .carousel-caption p {
        font-size: 0.9rem;
    }
    
    /* Category Cards */
    .category-card {
        padding: 1rem;
    }
    
    /* WhatsApp Float */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
    
    /* Top Bar */
    .bg-dark .container {
        font-size: 0.8rem;
    }
    
    .bg-dark .container .row {
        flex-direction: column;
        text-align: center;
    }
    
    .bg-dark .container .col-md-6 {
        margin-bottom: 5px;
    }
    
    /* Footer */
    .footer-section {
        margin-bottom: 2rem;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    /* Alerts */
    .alert {
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination .page-link {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    /* Accordion */
    .accordion-button {
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    
    .accordion-body {
        font-size: 0.9rem;
        padding: 15px;
    }
    
    /* Dropdown */
    .dropdown-menu {
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 8px 15px;
    }
    
    /* Input Group */
    .input-group .btn {
        padding: 10px 15px;
    }
    
    /* List Group */
    .list-group-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Progress Bar */
    .progress {
        height: 20px;
    }
    
    /* Spinner */
    .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    /* Toast */
    .toast {
        width: 100%;
        max-width: 350px;
    }
    
    /* Carousel */
    .carousel-indicators {
        bottom: 10px;
    }
    
    .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }
    
    /* Touch-friendly targets */
    .btn, .nav-link, .dropdown-item, .list-group-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove touch highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Optimize text selection */
    ::selection {
        background: #667eea;
        color: white;
    }
    
    /* Container padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Row spacing */
    .row > .col,
    .row > [class*="col-"] {
        padding-left: 7.5px;
        padding-right: 7.5px;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    section {
        padding: 30px 0;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .product-card .product-image {
        height: 120px;
    }
    
    .hero-section .carousel-item {
        height: 200px;
    }
    
    .hero-section .carousel-caption h2 {
        font-size: 1rem;
    }
    
    .whatsapp-float {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th, .table td {
        padding: 6px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section .carousel-item {
        height: 150px;
    }
    
    .hero-section .carousel-caption {
        padding: 10px;
    }
    
    .hero-section .carousel-caption h2 {
        font-size: 1rem;
    }
    
    section {
        padding: 30px 0;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .card:hover {
        transform: none;
    }
    
    .product-card .product-actions {
        bottom: 0;
    }
    
    .hover-lift:hover {
        transform: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand img,
    .product-card .product-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    .btn,
    .hero-section {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* iPad/Tablet Specific */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    .product-card .product-image {
        height: 180px;
    }
}

/* Safe Area for Notch Devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .whatsapp-float {
        bottom: max(15px, env(safe-area-inset-bottom));
        right: max(15px, env(safe-area-inset-right));
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .pulse,
    .shake {
        animation: none;
    }
}

/* Custom Scrollbar for Mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 5px;
        height: 5px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgba(102, 126, 234, 0.5);
        border-radius: 5px;
    }
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .navbar-collapse {
        background: white;
        padding: 15px;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .dropdown-menu {
        position: static !important;
        width: 100%;
        border: none;
        box-shadow: none;
        padding-left: 15px;
    }
    
    .dropdown-item {
        padding: 10px 15px;
    }
}

/* Mobile Form Optimizations */
@media (max-width: 768px) {
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="month"] {
        font-size: 16px;
    }
    
    select {
        appearance: none;
        background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23667eea%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 12px;
    }
}
