/**
 * Vebses Apartments System - Common Styles
 * 
 * Shared styles, variables, fonts, and utilities
 * 
 * @package VebsesApartments
 * @since 1.0.0
 */

/* ==========================================================================
   Neutralize Mobile Tap Highlight
   ========================================================================== */
.re-widget [type=button],
.re-widget [type=submit],
.re-widget button {
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   FOUC Prevention - Hide widgets until CSS is loaded
   ========================================================================== */

.re-widget:not(.re-widget--ready) {
    visibility: hidden;
    opacity: 0;
}

.re-widget.re-widget--ready {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* No JS fallback - show widgets after 1 second */
@keyframes re-fouc-fallback {
    to {
        visibility: visible;
        opacity: 1;
    }
}

.re-widget:not(.re-widget--ready) {
    animation: re-fouc-fallback 0s 1s forwards;
}

/* ==========================================================================
   NOTE: No @font-face declarations here!
   
   We use the site's existing fonts (inherit) to avoid:
   1. Overriding TBCCaps or other theme fonts globally
   2. CORS issues with CDN fonts
   3. Font loading flashes
   
   The widgets will use whatever font the theme provides.
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Brand Colors */
    --re-brand-primary: #510B0B;
    --re-brand-secondary: #5D1520;
    --re-brand-light: #FFF5F5;
    --re-brand-hover: #7A1B2A;
    
    /* Text Colors */
    --re-text-primary: #000000;
    --re-text-secondary: #C6C6C6;
    --re-text-tertiary: #999999;
    --re-text-white: #FFFFFF;
    
    /* Border Colors */
    --re-border-default: #D0D0D0;
    --re-border-divider: #E5E5E5;
    --re-border-card: rgba(0, 0, 0, 0.2);
    
    /* Background Colors */
    --re-bg-page: #F5F5F0;
    --re-bg-white: #FFFFFF;
    
    /* Glassmorphism */
    --re-glass-bg: rgba(255, 255, 255, 0.05);
    --re-glass-border: rgba(255, 255, 255, 0.09);
    --re-glass-divider: rgba(255, 255, 255, 0.12);
    
    /* Typography - Inherit from theme to avoid overriding site fonts */
    --re-font-primary: inherit;
    
    /* Font Sizes */
    --re-font-size-xs: 12px;
    --re-font-size-sm: 14px;
    --re-font-size-md: 16px;
    --re-font-size-lg: 18px;
    --re-font-size-xl: 20px;
    --re-font-size-2xl: 24px;
    
    /* Spacing */
    --re-spacing-xs: 8px;
    --re-spacing-sm: 12px;
    --re-spacing-md: 16px;
    --re-spacing-lg: 20px;
    --re-spacing-xl: 30px;
    --re-spacing-2xl: 40px;
    
    /* Border Radius */
    --re-radius-sm: 5px;
    --re-radius-md: 8px;
    --re-radius-lg: 20px;
    --re-radius-full: 50%;
    
    /* Transitions */
    --re-transition-fast: 200ms ease;
    --re-transition-normal: 300ms ease;
    --re-transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --re-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.1);
    --re-shadow-md: 0 4px 12px rgba(81, 11, 11, 0.1);
    --re-shadow-lg: 0 4px 20px rgba(81, 11, 11, 0.15);
    
    /* Z-index Scale */
    --re-z-dropdown: 100;
    --re-z-modal: 200;
    --re-z-notification: 300;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

.re-widget,
.re-widget * {
    box-sizing: border-box;
}

.re-widget {
    font-family: inherit;
    font-size: var(--re-font-size-md);
    line-height: 1.5;
    color: var(--re-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Accessibility - Focus States
   ========================================================================== */

.re-widget *:focus {
    outline: none;
}

.re-widget *:focus-visible {
    outline: 2px solid var(--re-brand-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.re-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;
}

.re-hidden {
    display: none !important;
}

/* ==========================================================================
   Loading & Animation States
   ========================================================================== */

.re-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: re-skeleton-loading 1.5s infinite;
}

@keyframes re-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.re-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--re-border-divider);
    border-top-color: var(--re-brand-primary);
    border-radius: 50%;
    animation: re-spin 0.8s linear infinite;
}

@keyframes re-spin {
    to { transform: rotate(360deg); }
}

.re-fade-in {
    animation: re-fade-in 0.3s ease-out;
}

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

/* ==========================================================================
   Notification Component
   ========================================================================== */

.re-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: var(--re-spacing-md) var(--re-spacing-lg);
    background: var(--re-bg-white);
    border-radius: var(--re-radius-md);
    box-shadow: var(--re-shadow-lg);
    transform: translateX(120%);
    transition: transform var(--re-transition-smooth);
    z-index: var(--re-z-notification);
}

.re-notification.show {
    transform: translateX(0);
}

.re-notification-error {
    border-left: 4px solid #dc3232;
}

.re-notification-success {
    border-left: 4px solid #46b450;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.re-empty-state {
    text-align: center;
    padding: var(--re-spacing-2xl);
}

.re-empty-state__icon {
    font-size: 48px;
    color: var(--re-text-tertiary);
    margin-bottom: var(--re-spacing-md);
}

.re-empty-state__title {
    font-size: var(--re-font-size-xl);
    font-weight: 600;
    color: var(--re-text-primary);
    margin-bottom: var(--re-spacing-xs);
}

.re-empty-state__text {
    font-size: var(--re-font-size-sm);
    color: var(--re-text-tertiary);
}

/* ==========================================================================
   Responsive Container
   ========================================================================== */

.re-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--re-spacing-lg);
}

@media (max-width: 768px) {
    .re-container {
        padding: 0 var(--re-spacing-md);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .re-widget {
        background: white !important;
        color: black !important;
    }
    
    .re-notification,
    .re-spinner {
        display: none !important;
    }
}
