/* Custom styles for ORANZ website */

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

/* Custom gradient backgrounds */
.gradient-blue {
    background: linear-gradient(135deg, #081529 0%, #081529 100%);
}

/* Hero section styling */
.hero-overlay {
    background: linear-gradient(to right, rgba(8, 21, 41, 0.8), rgba(8, 21, 41, 0.4), rgba(8, 21, 41, 0.1), transparent);
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Button hover effects */
.btn-hover-effect {
    transition: all 0.3s ease;
    transform: translateY(0);
}

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

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Custom focus styles */
.focus-blue:focus {
    outline: none;
    ring: 2px solid #081529;
    ring-offset: 2px;
}

/* Navigation hover effects */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #081529;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Social media icons */
.social-icon {
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* Back to top button */
#back-to-top {
    transition: all 0.3s ease;
}

/* Custom scrollbar - Removed to use browser default */

/* Typography enhancements */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile menu animations */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Loading animations */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #081529;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design helpers */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    /* Mobile touch improvements */
    button, .btn, a[role="button"], input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Larger tap targets for mobile */
    .touch-target {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    /* Improve form elements on mobile */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
    
    /* Better mobile menu interactions */
    #mobile-menu a {
        min-height: 48px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
    }
    
    /* Mobile-specific hover states (disable hover on touch devices) */
    @media (hover: none) and (pointer: coarse) {
        .hover\:bg-opacity-30:hover {
            background-color: initial;
        }
        
        .hover\:shadow-xl:hover {
            box-shadow: initial;
        }
        
        .hover\:-translate-y-1:hover {
            transform: initial;
        }
    }
}

/* Mobile landscape orientation optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Reduce hero section height on landscape mobile */
    .min-h-screen {
        min-height: 80vh;
    }
    
    /* Compact header on landscape */
    header .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    /* Adjust logo size */
    header img {
        height: 3rem;
        width: 3rem;
    }
    
    /* Reduce navigation height */
    nav {
        min-height: 3rem;
    }
    
    /* Compact overlays */
    #constructionOverlay .bg-white,
    #contactFormOverlay .text-white {
        padding: 1rem;
        margin: 1rem;
    }
    
    /* Reduce text sizes slightly */
    h1 {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    
    /* Compact buttons */
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Very small screens (320px and below) */
@media (max-width: 320px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3 {
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Stack footer columns on very small screens */
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* 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 for better accessibility */
.focus-visible:focus-visible {
    outline: 2px solid #081529;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-300 {
        color: #ffffff;
    }
    
    .text-gray-600 {
        color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Table of Contents (TOC) Styles */
#table-of-contents {
    position: fixed;
    top: 120px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 200px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 40;
    transition: all 0.3s ease;
    transform: translateX(-100%);
    opacity: 0;
    overflow: hidden;
}

#table-of-contents.visible {
    transform: translateX(0);
    opacity: 1;
}



.toc-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #081529 0%, #072a5e 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}



.toc-close-btn {
    background: none;
    border: none;
    color: #ffb505;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-close-btn:hover {
    background: rgba(255, 181, 5, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}



.toc-content {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding: 12px 0;
    transition: all 0.3s ease;
}



.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item {
    margin: 0;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.toc-item.active {
    border-left-color: #ffb505;
    background: linear-gradient(90deg, rgba(255, 181, 5, 0.1) 0%, transparent 100%);
}

.toc-link {
    display: block;
    padding: 8px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-radius: 0 8px 8px 0;
}

.toc-link:hover {
    color: #081529;
    background: rgba(8, 21, 41, 0.05);
    transform: translateX(4px);
}

.toc-item.active .toc-link {
    color: #081529;
    font-weight: 600;
}

/* Level indentation */
.toc-item.level-3 .toc-link {
    padding-left: 32px;
    font-size: 12px;
}

.toc-item.level-4 .toc-link {
    padding-left: 44px;
    font-size: 11px;
}

/* TOC Toggle Button */
#toc-toggle-btn {
    position: fixed;
    top: 120px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #081529 0%, #072a5e 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 41;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
}

#toc-toggle-btn.visible {
    opacity: 1;
    transform: scale(1);
}

#toc-toggle-btn:hover {
    background: linear-gradient(135deg, #0a1a2e 0%, #081426 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#toc-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Progress Bar */
.toc-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffb505 0%, #ea7101 100%);
    border-radius: 0 0 12px 12px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive Design */
@media (max-width: 1280px) {
    #table-of-contents {
        left: 10px;
        width: 260px;
    }
    
    #toc-toggle-btn {
        left: 10px;
    }
}

@media (max-width: 1024px) {
    #table-of-contents {
        transform: translateX(-100%);
        width: 280px;
        top: 100px;
        left: 0;
        border-radius: 0 12px 12px 0;
    }
    
    #toc-toggle-btn {
        left: 10px;
        top: 100px;
    }
}

@media (max-width: 768px) {
    #table-of-contents {
        display: none !important;
    }
    
    #toc-toggle-btn {
        display: none !important;
    }
}

/* Animation for scroll highlight */
@keyframes tocHighlight {
    0% { background: rgba(255, 181, 5, 0.3); }
    100% { background: rgba(255, 181, 5, 0.1); }
}

.toc-item.highlight {
    animation: tocHighlight 0.6s ease;
}

/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 21, 41, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.search-container {
    width: 100%;
    max-width: 600px;
    margin-top: 8vh;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

/* Search Header */
.search-header {
    margin-bottom: 1rem;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    width: 20px;
    height: 20px;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: #1f2937;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-close {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Search Placeholder */
.search-placeholder,
.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.search-placeholder-icon,
.search-no-results-icon {
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.search-placeholder-text,
.search-no-results-text {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

.search-no-results-subtext {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0.5rem 0 0 0;
}

/* Search Results Header */
.search-results-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.search-results-count {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* Search Result Items */
.search-results-list {
    padding: 0.5rem 0;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 6px;
    margin: 0 0.5rem;
}

.search-result-item:hover,
.search-result-item.active {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.search-result-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    margin-right: 1rem;
}

.search-result-link {
    color: #081529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-link:hover {
    color: #ffb505;
}

.search-result-score {
    font-size: 0.75rem;
    color: #10b981;
    background: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
}

.search-result-excerpt {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
}

.search-result-url {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Search Result Highlighting */
.search-result-item mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Main Content Blur Effect */
.search-blur {
    filter: blur(3px);
    transition: filter 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-overlay {
        padding: 1rem;
    }
    
    .search-container {
        margin-top: 4vh;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }
    
    .search-icon {
        left: 0.875rem;
        width: 18px;
        height: 18px;
    }
    
    .search-close {
        right: 0.625rem;
    }
    
    .search-results {
        max-height: 50vh;
    }
    
    .search-result-item {
        padding: 0.875rem 1rem;
    }
    
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .search-result-title {
        margin-right: 0;
    }
}

/* Search Animation Keyframes */
@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-result-item {
    animation: searchFadeIn 0.2s ease;
}



/* Print Styles */
@media print {
    .search-overlay {
        display: none !important;
    }
}