/**
 * Water Prime Su Arıtma - Custom Styles
 * TailwindCSS ile birlikte kullanılır
 */

/* ============================================
   BASE STYLES
   ============================================ */

/* Container max-width */
.container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

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

/* Selection color */
::selection {
    background-color: #00B4D8;
    color: white;
}

/* Hide elements with x-cloak until Alpine loads */
[x-cloak] {
    display: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Float animation for water drops */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
        opacity: 0.6;
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-30px) rotate(-10deg);
        opacity: 0.5;
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

/* Morph animation for hero shape */
@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%;
        transform: rotate(10deg);
    }
}

@keyframes morph-delayed {
    0%, 100% {
        border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
        transform: rotate(-10deg);
    }
}

.animate-morph {
    animation: morph 8s ease-in-out infinite;
}

.animate-morph-delayed {
    animation: morph-delayed 8s ease-in-out infinite;
    animation-delay: 2s;
}

/* Pulse animation for WhatsApp button */
@keyframes ping {
    75%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Line clamp for text truncation */
.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;
}

/* ============================================
   COMPONENT STYLES
   ============================================ */

/* Header sticky shadow on scroll */
header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Navigation dropdown */
.nav-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Product card hover effect */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Service card gradient on hover */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #00B4D8 0%, #0096C7 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   FORM STYLES
   ============================================ */

/* Input focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #00B4D8;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

/* Custom checkbox */
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
    background-color: #00B4D8;
    border-color: #00B4D8;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */

/* Hide scrollbar utility class */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Mobile navigation */
@media (max-width: 1023px) {
    .mobile-nav {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* Reduce animations on mobile for performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-essential elements */
    header,
    footer,
    .floating-whatsapp,
    .back-to-top {
        display: none !important;
    }

    /* Reset backgrounds */
    body {
        background: white !important;
    }

    /* Show full URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */

/* Sidebar active state */
.admin-sidebar-item.active {
    background-color: rgba(0, 180, 216, 0.1);
    color: #00B4D8;
    border-left: 3px solid #00B4D8;
}

/* Data table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background-color: #e0f2fe;
    color: #0284c7;
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton loading */
.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;
    }
}

/* Button loading spinner */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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