/**
 * Public Site UX Improvements CSS
 * Toast notifications, form validation, touch targets, responsive improvements
 */

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-success i {
    color: var(--success-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

.toast-error i {
    color: var(--danger-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-warning i {
    color: var(--warning-color);
}

.toast-info {
    border-left-color: var(--info-color);
}

.toast-info i {
    color: var(--info-color);
}

/* ===== TOUCH TARGET SIZE (Min 44x44px) ===== */
.btn, 
.nav-link, 
input[type="submit"], 
input[type="button"], 
button:not(.toast-close),
.form-check-input,
a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 1rem;
}

.btn-lg {
    min-height: 52px;
    padding: 1rem 2rem;
}

/* Touch feedback */
.btn:active,
button:active,
.nav-link:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* ===== FORM VALIDATION STYLES ===== */
.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4'/%3e%3cpath d='m6.2 8.4-.4-.4-.4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: var(--success-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */

/* Hero Section Mobile Optimization */
.hero-section {
    padding: 3rem 0 5rem; /* Mobile default */
}

@media (min-width: 576px) {
    .hero-section {
        padding: 4rem 0 6rem;
    }
}

@media (min-width: 768px) {
    .hero-section {
        padding: 5rem 0 7rem;
    }
}

@media (min-width: 992px) {
    .hero-section {
        padding: 8rem 0 10rem;
    }
}

/* Hero Title Responsive */
.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }
}

/* Hero Subtitle Responsive */
.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

@media (max-width: 576px) {
    .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* Product Filters Mobile */
@media (max-width: 576px) {
    .filters-card {
        padding: 1rem;
    }
    
    .filters-form .row > div {
        margin-bottom: 1rem;
    }
    
    .filters-form .btn {
        width: 100%;
    }
}

/* Quote Section Mobile */
@media (max-width: 768px) {
    .quote-section {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }
    
    .quote-section .card {
        border-radius: 12px;
    }
}

/* Container Padding Mobile */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Card Padding Mobile */
@media (max-width: 576px) {
    .stats-card,
    .category-card,
    .product-card,
    .quote-form-card,
    .contact-card {
        padding: 1.25rem;
    }
}

/* Section Spacing Mobile */
@media (max-width: 576px) {
    section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

/* Toast Container Mobile */
@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hide {
        transform: translateY(-100px);
    }
}

/* ===== IMAGE LAZY LOADING ===== */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

img[data-src] {
    background: #f0f0f0;
    min-height: 200px;
}

/* ===== FOCUS STATES (Accessibility) ===== */
.btn:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== LOADING SPINNER ===== */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ===== MOBILE MENU IMPROVEMENTS ===== */
@media (max-width: 991px) {
    /* Animasyonları kaldır, sadece Bootstrap'in collapse mekanizmasını kullan */
    .navbar-collapse.collapsing {
        transition-timing-function: ease-out !important;
    }
    
    /* Dropdown menü optimizasyonu */
    .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.5rem !important;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: none !important;
    }
    
    .navbar-collapse .dropdown-menu.show {
        animation: none !important;
        display: block !important;
    }
    
    /* Dropdown parent click'ini engelle */
    .navbar-collapse .nav-item.dropdown {
        pointer-events: auto;
    }
    
    .navbar-collapse .nav-item.dropdown > .nav-link {
        pointer-events: auto;
    }
}

/* ===== FORM IMPROVEMENTS ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(59, 82, 241, 0.15);
}

/* Input group improvements */
.input-group .form-control:focus {
    z-index: 3;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 576px) {
    h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
    h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
    h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
    h6 { font-size: clamp(0.9rem, 1.5vw, 1rem); }
}

/* ===== PAGE HEADER MOBILE ===== */
@media (max-width: 576px) {
    .modern-page-header {
        padding: 3rem 0 5rem;
    }
    
    .page-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .page-subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }
}

/* ===== SMOOTH ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

