/**
 * SuniStils.lv - Custom Styles
 * Additional CSS to complement Tailwind
 * @version 1.0.0
 */

/* ==========================================
   Base Styles & Reset
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Remove default button styles */
button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
}

/* Remove default input styles */
input,
textarea,
select {
    font: inherit;
}

/* Remove default link styles */
a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Custom Scrollbar
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #d4a574;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c49464;
}

/* ==========================================
   Navigation Styles
   ========================================== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #d4a574;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ==========================================
   Product Card Hover Effects
   ========================================== */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.product-card .product-image {
    overflow: hidden;
}

.product-card .product-image img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* ==========================================
   Button Styles
   ========================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #d4a574;
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #c49464;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 2px solid #1a1a1a;
    color: #1a1a1a;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #1a1a1a;
    color: white;
}

/* ==========================================
   Form Styles
   ========================================== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1a1a1a;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    accent-color: #d4a574;
}

/* ==========================================
   Accordion Styles
   ========================================== */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 1000px;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-icon.open {
    transform: rotate(180deg);
}

/* ==========================================
   Tab Styles
   ========================================== */
.tab-btn {
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn.active {
    color: #d4a574;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #d4a574;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   Cart Sidebar Animation
   ========================================== */
.cart-sidebar {
    transition: transform 0.3s ease-in-out;
}

.cart-overlay {
    transition: opacity 0.3s ease-in-out;
}

/* ==========================================
   Mobile Menu Animation
   ========================================== */
.mobile-menu {
    transition: transform 0.3s ease-in-out;
}

/* ==========================================
   Hero Section Overlay
   ========================================== */
.hero-overlay {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    );
}

/* ==========================================
   Image Hover Effects
   ========================================== */
.image-hover {
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.5s ease;
}

.image-hover:hover img {
    transform: scale(1.1);
}

/* ==========================================
   Loading Spinner
   ========================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #d4a574;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   Fade In Animation
   ========================================== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Slide In Animation
   ========================================== */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   Toast Animation
   ========================================== */
.toast {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   Line Clamp Utilities
   ========================================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   Aspect Ratio Utilities
   ========================================== */
.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-3-4 {
    aspect-ratio: 3 / 4;
}

/* ==========================================
   Focus Styles for Accessibility
   ========================================== */
:focus-visible {
    outline: 2px solid #d4a574;
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================
   Skip Link for Accessibility
   ========================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #d4a574;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* ==========================================
   Responsive Typography
   ========================================== */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1536px) {
    html {
        font-size: 18px;
    }
}

/* ==========================================
   Safe Area for Notched Devices
   ========================================== */
@supports (padding: max(0px)) {
    .safe-area-inset-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .safe-area-inset-top {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* ==========================================
   Reduced Motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================
   Dark Mode Support (if needed in future)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* ==========================================
   High Contrast Mode Support
   ========================================== */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
}

/* ==========================================
   Selection Styles
   ========================================== */
::selection {
    background-color: #d4a574;
    color: white;
}

::-moz-selection {
    background-color: #d4a574;
    color: white;
}

/* ==========================================
   Placeholder Styles
   ========================================== */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
}

::-ms-input-placeholder {
    color: #9ca3af;
}

/* ==========================================
   Focus Within Styles
   ========================================== */
.focus-within-ring:focus-within {
    ring: 2px;
    ring-color: #d4a574;
}

/* ==========================================
   Group Hover Effects
   ========================================== */
.group:hover .group-hover-visible {
    opacity: 1;
    visibility: visible;
}

.group:hover .group-hover-hidden {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================
   Sticky Header Shadow
   ========================================== */
.header-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==========================================
   Card Shadow on Hover
   ========================================== */
.card-hover-shadow {
    transition: box-shadow 0.3s ease;
}

.card-hover-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================
   Gradient Text
   ========================================== */
.gradient-text {
    background: linear-gradient(135deg, #d4a574 0%, #c49464 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   Glass Morphism Effect
   ========================================== */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ==========================================
   Custom List Styles
   ========================================== */
.custom-list li {
    position: relative;
    padding-left: 1.5rem;
}

.custom-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background-color: #d4a574;
    border-radius: 50%;
}

/* ==========================================
   Price Tag Styles
   ========================================== */
.price-tag {
    position: relative;
    display: inline-block;
}

.price-tag::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background-color: rgba(212, 165, 116, 0.2);
    z-index: -1;
}

/* ==========================================
   Badge Styles
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-new {
    background-color: #d4a574;
    color: white;
}

.badge-sale {
    background-color: #ef4444;
    color: white;
}

.badge-popular {
    background-color: #10b981;
    color: white;
}

/* ==========================================
   Table Styles
   ========================================== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom th,
.table-custom td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.table-custom th {
    font-weight: 600;
    color: #1a1a1a;
    background-color: #f8f8f8;
}

.table-custom tr:hover td {
    background-color: #faf9f7;
}

/* ==========================================
   Responsive Table
   ========================================== */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================
   Tooltip Styles
   ========================================== */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   Star Rating
   ========================================== */
.star-rating {
    display: inline-flex;
    gap: 0.25rem;
}

.star-rating .star {
    color: #d4d4d4;
}

.star-rating .star.filled {
    color: #d4a574;
}

.star-rating .star.half {
    background: linear-gradient(90deg, #d4a574 50%, #d4d4d4 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
