/* Custom CSS for HPG Kapital Website */

/* Tailwind base styles are included via tailwind.css */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* Custom animations - EXACT match to React/Framer Motion */

/* Fade-up animation matches Framer Motion: 
   initial={{ opacity: 0, y: 40 }}
   animate={{ opacity: 1, y: 0 }}
   transition={{ duration: 0.6, ease: "easeOut" }}
*/
@keyframes fade-up {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service card hover - matches Framer Motion whileHover={{ y: -8 }} */
.service-card {
    transition: transform 0.2s ease-out, box-shadow 0.3s ease-out;
}

.service-card:hover {
    transform: translateY(-8px);
}

.service-card img {
    transition: transform 0.5s ease-out;
}

.service-card:hover img {
    transform: scale(1.1);
}

/* Hero parallax - Enhanced for smooth performance */
.hero-parallax {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    /* Ensure image covers full area and scales properly */
    transform-origin: center center;
    /* Smooth transitions */
    transition: transform 0.1s ease-out;
}

/* Fixed background for hero sections (all pages except home) */
.bg-fixed {
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Disable fixed background on mobile for better performance */
@media (max-width: 768px) {
    .bg-fixed {
        background-attachment: scroll;
    }
}

/* Enhanced Responsive Design - Mobile First Approach */

/* Extra Small Devices (phones, 320px and up) */
@media (max-width: 375px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    .text-4xl {
        font-size: 1.5rem !important;
    }
    
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-6xl {
        font-size: 2.5rem !important;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Ensure grid layouts work on tablets */
    .grid {
        gap: 1.5rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    /* Header adjustments */
    header {
        padding: 0.75rem 0;
    }
    
    header img {
        height: 3rem !important;
        max-width: 150px;
    }
    
    /* Navigation improvements */
    #mobile-menu {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    /* Form improvements */
    form input,
    form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Button improvements */
    button,
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Card spacing */
    .bg-card {
        padding: 1.5rem !important;
    }
    
    /* Section padding */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Hero sections */
    .min-h-screen {
        min-height: 70vh !important;
    }
    
    .min-h-\[60vh\] {
        min-height: 50vh !important;
    }
    
    /* Text sizes */
    .text-lg {
        font-size: 1rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    /* Grid improvements */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Spacing adjustments */
    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1.25rem;
    }
    
    /* Image responsiveness */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Footer improvements */
    footer .grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    footer .text-center {
        text-align: center !important;
    }
}

/* Tablet-specific improvements */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop-specific improvements */
@media (min-width: 1024px) {
    /* Ensure proper spacing on large screens */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Hover effects only on desktop */
    .service-card:hover {
        transform: translateY(-8px);
    }
    
    /* Better grid layouts */
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape orientation adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    .min-h-screen {
        min-height: 100vh !important;
    }
    
    header {
        padding: 0.5rem 0;
    }
    
    header img {
        height: 2.5rem !important;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    nav {
        display: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Skip link */
.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;
}

.sr-only:focus {
    position: fixed;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    z-index: 9999;
}

/* Touch target size */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* Smooth transitions */
* {
    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 styles for accessibility - only show on keyboard navigation */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid hsl(var(--royal-blue));
    outline-offset: 2px;
}

/* Remove click outline/selection box */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button, a {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Keep text selectable in content areas */
p, span, div:not([role="button"]), td, th {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Form validation styles */
.is-invalid {
    border-color: #dc2626 !important;
    border-width: 2px !important;
}

.is-valid {
    border-color: #16a34a !important;
}

.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Print styles */
@media print {
    header,
    footer,
    nav {
        display: none;
    }
}

