/* TerrasSen Custom Styles */
/* Optimized for performance and modern UX */

/* Performance optimizations */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Preload critical fonts */
@font-display: swap;

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation classes */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

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

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(44, 85, 48, 0.3);
    border-radius: 50%;
    border-top-color: #2C5530;
    animation: spin 1s ease-in-out infinite;
}

/* Improved form styles */
.form-floating-modern {
    position: relative;
}

.form-floating-modern input,
.form-floating-modern textarea {
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

.form-floating-modern input:focus,
.form-floating-modern textarea:focus {
    border-color: #2C5530;
    box-shadow: 0 0 0 0.2rem rgba(44, 85, 48, 0.25);
    outline: none;
}

.form-floating-modern label {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    color: #718096;
    font-size: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 0.5rem;
}

.form-floating-modern input:focus + label,
.form-floating-modern input:not(:placeholder-shown) + label,
.form-floating-modern textarea:focus + label,
.form-floating-modern textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 1rem;
    font-size: 0.8rem;
    color: #2C5530;
    font-weight: 600;
}

/* Enhanced buttons */
.btn-gradient {
    background: linear-gradient(135deg, #2C5530, #4A7C59);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(44, 85, 48, 0.3);
    color: white;
}

/* Card enhancements */
.card-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Image optimizations */
.img-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-lazy.loaded {
    opacity: 1;
}

.img-cover {
    object-fit: cover;
    object-position: center;
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-padding {
        padding: 1rem !important;
    }
}

/* Performance: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a202c;
        --bg-white: #2d3748;
        --text-dark: #f7fafc;
        --text-light: #a0aec0;
        --border-color: #4a5568;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* 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: 0;
}

.focus-visible:focus {
    outline: 2px solid #2C5530;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary-custom,
    .btn-gradient {
        border: 2px solid currentColor;
    }
}

/* Reduced transparency for better readability */
@media (prefers-reduced-transparency: reduce) {
    .card-glass {
        background: rgba(255, 255, 255, 1);
        backdrop-filter: none;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #2C5530;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1E3B23;
}

/* Selection styles */
::selection {
    background: rgba(44, 85, 48, 0.2);
    color: #2C5530;
}

::-moz-selection {
    background: rgba(44, 85, 48, 0.2);
    color: #2C5530;
}
