/* ==========================================================================
   ORYX IT Website - Optimized CSS (v2.1) 
   Final optimization: removed unused classes and consolidated redundant styles
   ========================================================================== */

/* ==========================================================================
   1. ESSENTIAL UTILITY CLASSES (Not available in Tailwind)
   ========================================================================== */

/* GTM noscript iframe - utility class for inline style replacement */
.gtm-noscript {
    display: none;
    visibility: hidden;
    height: 0;
    width: 0;
}

/* Honeypot field - security measure, must use !important to ensure hiding */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Logo error state - specific styling for broken logo fallback */
.logo-error {
    border: 1px dashed theme('colors.gray.300');
    border-radius: theme('borderRadius.DEFAULT');
}

/* ==========================================================================
   2. VISIBILITY AND STATE MANAGEMENT (Simplified approach)
   ========================================================================== */

/* Base hidden state - used by JavaScript for multiple components */
.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Base visible state with smooth transition */
.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Loading overlay - managed entirely via JavaScript */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

/* Content visibility with fade-in animation */
.content-fade-in {
    animation: contentFadeIn 0.3s ease-out;
}

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

/* No-JS fallback - ensures content is always visible */
.no-js [data-js-hidden] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==========================================================================
   3. COMPONENT-SPECIFIC STYLES (Complex interactions)
   ========================================================================== */

/* Language switcher dropdown - optimized state management */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid theme('colors.gray.200');
    border-radius: theme('borderRadius.md');
    box-shadow: theme('boxShadow.lg');
    min-width: 120px;
    z-index: 50;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    pointer-events: none;
}

.language-dropdown[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.language-dropdown-item {
    display: block;
    padding: theme('spacing.2') theme('spacing.3');
    color: theme('colors.gray.700');
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.language-dropdown-item:hover {
    background-color: theme('colors.gray.50');
}

.language-dropdown-item[data-active="true"] {
    background-color: theme('colors.orange.50');
    color: theme('colors.orange.600');
    font-weight: theme('fontWeight.medium');
}

/* Language switcher toggle - simplified state */
.language-switcher-toggle {
    display: flex;
    align-items: center;
    padding: theme('spacing.2');
    background: transparent;
    border: none;
    border-radius: theme('borderRadius.md');
    color: theme('colors.gray.600');
    font-weight: theme('fontWeight.medium');
    cursor: pointer;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.language-switcher-toggle:hover {
    color: theme('colors.gray.800');
    background-color: theme('colors.gray.100');
}

.language-switcher-toggle svg {
    margin-left: theme('spacing.1');
    width: theme('spacing.5');
    height: theme('spacing.5');
    transition: transform 0.2s ease-in-out;
}

.language-switcher-toggle[data-open="true"] svg {
    transform: rotate(180deg);
}

/* Custom bullet points for privacy policy lists */
.custom-bullets {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.custom-bullets li {
    position: relative;
    padding-left: theme('spacing.6');
    margin-bottom: theme('spacing.2');
    line-height: 1.6;
}

.custom-bullets li:last-child {
    margin-bottom: 0;
}

.custom-bullets li::before {
    content: '';
    position: absolute;
    left: theme('spacing.2');
    top: 0.8em;
    transform: translateY(-50%);
    width: 0.375rem;
    height: 0.375rem;
    background-color: theme('colors.orange.500');
    border-radius: 50%;
}

/* Back to top button - optimized with unified visibility management */
#backToTopBtn {
    position: fixed;
    bottom: theme('spacing.5');
    right: theme('spacing.8');
    z-index: 50;
    width: theme('spacing.12');
    height: theme('spacing.12');
    background-color: theme('colors.orange.600');
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: theme('boxShadow.lg');
    transition: background-color 0.3s ease-in-out;
}

#backToTopBtn:hover {
    background-color: theme('colors.orange.700');
}

/* ==========================================================================
   4. FORM AND INTERACTIVE ELEMENTS (Optimized state handling)
   ========================================================================== */

/* Form message system - streamlined approach */
#form-message {
    padding: theme('spacing.4');
    margin-top: theme('spacing.4');
    border-radius: theme('borderRadius.md');
    font-size: theme('fontSize.sm');
    border-width: 1px;
    border-style: solid;
    white-space: pre-wrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
}

#form-message[data-type="success"] {
    background-color: theme('colors.green.100');
    color: theme('colors.green.800');
    border-color: theme('colors.green.300');
}

#form-message[data-type="error"] {
    background-color: theme('colors.red.100');
    color: theme('colors.red.800');
    border-color: theme('colors.red.300');
}

#form-close-message-button {
    background: none;
    border: none;
    color: currentColor;
    font-size: theme('fontSize.xl');
    font-weight: theme('fontWeight.bold');
    line-height: 1;
    padding: 0 theme('spacing.2');
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

#form-close-message-button:hover {
    opacity: 1;
}

/* Form validation error styles - for live validation feedback */
.field-error {
    color: theme('colors.red.600');
    font-size: theme('fontSize.sm');
    margin-top: theme('spacing.1');
}

/* ==========================================================================
   5. ENHANCED FOCUS STYLES (Accessibility)
   ========================================================================== */

/* Comprehensive focus styling for accessibility */
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible {
    outline: 2px dashed theme('colors.orange.500');
    outline-offset: 2px;
    box-shadow: 0 0 0 4px theme('colors.orange.500' / 30%);
}

/* ==========================================================================
   6. TYPOGRAPHY AND LAYOUT DEFAULTS
   ========================================================================== */

/* Font family fallback - ensures Inter is applied */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    scroll-behavior: smooth;
}

/* Breadcrumb navigation - semantic styling */
.breadcrumb [data-active="true"] {
    color: theme('colors.orange.500');
    font-weight: theme('fontWeight.medium');
}

.breadcrumb .separator {
    color: theme('colors.gray.500');
}

.required-asterisk {
    color: #dc2626; /* Tailwind red-600 */
    font-weight: bold;
    margin-left: 0.25em;
}

.custom-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(0.5rem);
    background: #fff;
    color: #991b1b; /* Tailwind red-800 */
    border: 1px solid #fca5a5; /* Tailwind red-300 */
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0.5em 1em;
    font-size: 0.875rem;
    z-index: 100;
    white-space: pre-line;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

input:focus + .custom-tooltip,
textarea:focus + .custom-tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* Polished Bootstrap dropdown styling */
.dropdown-toggle {
    transition: all 0.2s ease-in-out;
    border-color: #6b7280; /* gray-500 */
    font-weight: 500;
}

.dropdown-toggle:hover {
    background-color: #f3f4f6; /* gray-100 */
    border-color: #374151; /* gray-700 */
}

.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.25); /* orange focus ring */
}

.dropdown-menu {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb; /* gray-200 */
    min-width: 10rem;
}

.dropdown-item {
    transition: all 0.15s ease-in-out;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f3f4f6; /* gray-100 */
    color: #111827; /* gray-900 */
}

.dropdown-item:active {
    background-color: #e5e7eb; /* gray-200 */
}

/* Orange CTA button styling to match Tailwind orange-600/700 */
.bg-orange-600 {
    transition: all 0.2s ease-in-out;
}

.bg-orange-600:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.25);
}

/* Ensure consistent focus states */
.btn:focus,
.dropdown-toggle:focus,
a:focus {
    outline: 2px solid #f97316; /* orange-500 */
    outline-offset: 2px;
}

/* Bootstrap button size override for consistency */
.btn {
    font-weight: 500;
    letter-spacing: 0.025em;
} 