/* Custom Styles for Tailwind CSS Enhancement */

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


/* Mobile Responsive Fixes */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    section {
        padding-left: 0;
        padding-right: 0;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Performance: Reduce animations on mobile */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Disable AOS on very small screens for better performance */
    @media (max-width: 480px) {
        [data-aos] {
            opacity: 1 !important;
            transform: none !important;
        }
    }
}

/* Star Rating Styles */
.star-rating {
    cursor: pointer;
    transition: all 0.2s;
}

.star-rating.active i,
.star-rating:hover ~ .star-rating i {
    color: #d1d5db;
}

.star-rating.active i.fa-star,
.star-rating:hover i.fa-star,
.star-rating.active ~ .star-rating i.fa-star {
    color: #fbbf24;
}

.star-rating i.fa-star {
    color: #fbbf24;
}

.star-rating i.far {
    color: #d1d5db;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #0066cc, #004499);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #004499, #0066cc);
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
}

/* Mobile Menu Animation */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobileMenu.active,
#mobileMenu:not(.hidden) {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

/* Hamburger Animation */
#hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#hamburger.active span:nth-child(2) {
    opacity: 0;
}

#hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Form Input Focus Effects */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}


/* Text Selection */
::selection {
    background: #0066cc;
    color: white;
}

::-moz-selection {
    background: #0066cc;
    color: white;
}

/* Print Styles */
@media print {
    nav,
    footer,
    .no-print {
        display: none;
    }
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-primary {
        background: #000080;
    }
    
    .text-primary {
        color: #000080;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Can be customized if dark mode is needed */
}

/* Container Max Width */
.container {
    max-width: 1280px;
}

/* Ensure all containers are responsive */
.container,
.container-fluid {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Fix overflow issues */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Responsive images - Only apply if no Tailwind height/width classes */
img:not([class*="h-"]):not([class*="w-"]) {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix for floating shapes on mobile */
@media (max-width: 768px) {
    .absolute.top-20.left-10,
    .absolute.bottom-20.right-10,
    .absolute.top-1\/2.left-1\/4 {
        display: none;
    }
}


/* Smooth Transitions - Only apply to elements without Tailwind classes */
*:not([class*="transition"]):not([class*="duration"]):not([class*="ease"]) {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Image Optimization - Only apply if no Tailwind height/width classes */
img:not([class*="h-"]):not([class*="w-"]) {
    max-width: 100%;
    height: auto;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success Message Styles */
.form-success {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Message Styles */
.form-error {
    background: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .text-8xl {
        font-size: 3rem;
    }
    
    .text-7xl {
        font-size: 2.5rem;
    }
    
    .text-5xl {
        font-size: 2rem;
    }
}

/* Additional Responsive Fixes */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
        /* Fix image overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix logo overflow on mobile */
    nav img[src*="logo.svg"],
    footer img[src*="logo.svg"] {
        max-width: 120px !important;
        height: auto !important;
        object-fit: contain;
    }
}

/* Fix for very small screens */
@media (max-width: 375px) {
    .text-4xl {
        font-size: 1.75rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}

/* Portfolio Grid Animation */
.portfolio-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.portfolio-item.visible {
    opacity: 1;
    transform: translateY(0);
}


/* Contact Form Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Smooth Page Transitions */
.page-transition {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scroll to Top Button */
#scrollToTop {
    transition: all 0.3s ease;
}

#scrollToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.3);
}

#scrollToTop:active {
    transform: translateY(-2px);
}

/* Form Focus Effects */
.focused input,
.focused textarea,
.focused select {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}


