
/* GLOBAL VARIABLES */
:root {
    --color-brand-50: #fff7ed;
    --color-brand-600: #ea580c;
    --color-brand-700: #c2410c;
}

/* GLOBAL STYLES */
body { 
    -webkit-tap-highlight-color: transparent; 
    overscroll-behavior-y: auto; 
    background-color: var(--color-brand-50); 
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* CUSTOM FONTS */
@font-face {
    font-family: 'Aristo';
    src: url('fonts/aristo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.font-aristo {
    font-family: 'Aristo', 'Comic Sans MS', 'Chalkboard SE', 'Fredoka', sans-serif !important;
}

/* UTILITIES */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.safe-pt { padding-top: env(safe-area-inset-top, 0px); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 20px); }

/* INPUT NUMBER SPINNER HIDE */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* UI STABILITY CLASSES */
.modal-content-stable {
    min-height: 50vh;
    transition: height 0.3s ease;
}
.price-block-stable {
    min-height: 80px; 
}

/* ANIMATIONS */
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes voicePulse {
    0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(234, 88, 12, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.animate-fade-in { animation: fadeIn 0.2s ease-out; }
.animate-slide-up { animation: slideUp 0.3s ease-out; }
.animate-pop-in { animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.animate-voice-pulse { animation: voicePulse 1.5s infinite; }
.animate-shake { animation: shake 0.5s; }

/* --- SMART EDITOR (v18.01.76: SINGLE LAYER NATIVE) --- */
.editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: white;
    overflow: hidden;
}

/* The Gutter (Line numbers + Icons) */
.editor-gutter {
    width: 50px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb; 
    
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 22px; 
    
    text-align: right;
    padding-top: 12px; /* Match textarea padding */
    padding-bottom: 300px; 
    padding-right: 8px;
    user-select: none;
    overflow: hidden; 
}

/* The Editor Area Wrapper */
.editor-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    overflow: hidden; 
}

/* SINGLE LAYER TEXTAREA */
.editor-textarea-native {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    border: 0 !important;
    outline: none !important;
    padding: 12px 12px !important;
    padding-bottom: 300px !important; 
    
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 14px !important; 
    line-height: 22px !important;
    letter-spacing: 0px !important;
    font-weight: normal !important;
    
    white-space: pre !important; 
    overflow-wrap: normal !important;
    box-sizing: border-box !important;
    tab-size: 4;
    resize: none;
    
    /* Native scrolling */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- MOBILE OVERRIDE --- */
@media (max-width: 768px) {
    .editor-gutter { display: none !important; }

    .editor-textarea-native {
        position: relative !important; 
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 100% !important;
        
        /* Ensure readability on mobile */
        font-size: 16px !important; /* Prevents iOS zoom */
        line-height: 24px !important;
        padding-bottom: 50vh !important; 
    }
    
    .editor-wrapper {
        display: block !important; 
        overflow: visible !important; 
    }
    
    .editor-container {
        display: block !important;
        overflow: hidden !important; 
    }
}

/* Status Icons */
.gutter-icon {
    display: inline-block;
    width: 14px;
    text-align: center;
    margin-left: 4px;
    filter: grayscale(0.2);
}
.gutter-row {
    height: 22px; /* Match line-height */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

/* Syntax Colors (Still used for Preview) */
.syn-header { color: #9333ea; font-weight: normal; } 
.syn-location { color: #ea580c; font-weight: normal; text-decoration: underline; text-decoration-color: #fdba74; } 
.syn-date { color: #2563eb; font-weight: normal; background-color: #eff6ff; padding: 0 0px; } 
.syn-time { color: #dc2626; font-weight: normal; } 
.syn-status-ok { background-color: #dcfce7; border-radius: 50%; } 
.syn-status-open { background-color: #ffedd5; border-radius: 50%; } 
.syn-meta { color: #059669; font-style: italic; } 
.syn-comment { color: #9ca3af; } 
.syn-link { color: #9ca3af; text-decoration: none; opacity: 0.7; }

/* --- SCREENSHOT MODE --- */
body.screenshot-mode {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    overflow: visible !important;
    width: auto !important;
    height: auto !important;
}

body.screenshot-mode .hide-in-screenshot { display: none !important; }
body.screenshot-mode .location-icon { display: none !important; }
body.screenshot-mode .weather-badge { display: none !important; }
body.screenshot-mode .weather-display { display: none !important; }
body.screenshot-mode .seasonal-layer { display: none !important; }
body.screenshot-mode ::-webkit-scrollbar { display: none !important; }

body.screenshot-mode .sticky, 
body.screenshot-mode .fixed,
body.screenshot-mode .absolute.z-50,
body.screenshot-mode .absolute.z-40, 
body.screenshot-mode .absolute.z-30 { 
    position: static !important; 
    top: auto !important; 
    left: auto !important; 
    transform: none !important; 
}

body.screenshot-mode header, 
body.screenshot-mode .filter-bar { position: static !important; }

body.screenshot-mode .overflow-x-auto, 
body.screenshot-mode .overflow-y-auto,
body.screenshot-mode .overflow-hidden {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

body.screenshot-mode * {
    transition: none !important;
    animation: none !important;
    transform: none !important; 
    backdrop-filter: none !important;
    filter: none !important;
}

body.screenshot-mode .shadow-sm, 
body.screenshot-mode .shadow-md, 
body.screenshot-mode .shadow-lg,
body.screenshot-mode .drop-shadow-sm {
    box-shadow: none !important;
    filter: none !important;
}

body.screenshot-mode .line-clamp-1,
body.screenshot-mode .line-clamp-2,
body.screenshot-mode .truncate {
    overflow: visible !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    white-space: normal !important;
    text-overflow: clip !important;
    height: auto !important;
    max-width: none !important;
}

body.screenshot-mode .appt-badge, 
body.screenshot-mode .appt-court { 
    position: relative; 
    background-color: transparent !important; 
    border: none !important; 
    color: #333 !important; 
    font-weight: bold !important; 
}

body.screenshot-mode .public-count-badge {
    background-color: transparent !important;
    border: 1px solid #e5e7eb !important; 
    color: #4b5563 !important;
    opacity: 1 !important;
    display: inline-flex !important;
    visibility: visible !important;
    padding: 2px 6px !important;
}

body.screenshot-mode .highlight-span { 
    position: static !important; 
    display: inline !important; 
    background-color: #fef08a !important; 
    color: inherit !important;
}

body.screenshot-mode .unavailable-player { opacity: 1 !important; color: #9ca3af !important; text-decoration: none !important; }
body.screenshot-mode .maybe-player { opacity: 1 !important; font-style: italic !important; color: #4b5563 !important; }

.clean-mode .hide-in-clean-mode { display: none !important; }

.trainer-checkbox { transition: all 0.2s ease; }
.trainer-checkbox.selected { border-color: currentColor; background-color: rgba(255,255,255,0.8); }
