/**
 * CSS Reset and Base Styles
 *
 * Box-sizing, scrollbar styling, touch handling, and body defaults.
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Always show scrollbar to prevent layout shift when switching pages */
html {
    overflow-x: hidden;
    overflow-y: scroll;
    color-scheme: dark;
}

/* Custom Scrollbar Styling - WebKit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(233, 69, 96, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(233, 69, 96, 0.5) rgba(255, 255, 255, 0.05);
}

/* =====================================================================
   MOBILE TOUCH HANDLING - Prevent unintended zoom/selection
   ===================================================================== */

/* Global touch-action for all clickable elements */
button,
a,
.clickable,
[onclick],
input[type="button"],
input[type="submit"],
.btn,
.btn-primary,
.btn-secondary,
.nav-tab,
.mobile-nav-item,
.app-tile,
.lesson-card,
.hand-card,
.toggle-switch,
.filter-tag,
.calculator-card-slot,
.card-picker-flop-slot,
.card-picker-slot-remove,
.card-picker-confirm-btn,
.card-picker-clear-btn,
.card-picker-close,
.ranges-action-btn,
.bankroll-filter-toggle,
.reveal-street-btn,
.action-btn,
.modal-close,
.learn-modal-close {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on interactive elements during tap */
@media (max-width: 768px) {
    button,
    .btn,
    .nav-tab,
    .mobile-nav-item,
    .app-tile,
    .quiz-option,
    .card-picker-grid-card,
    .ranges-cell,
    .calculator-card-slot,
    .toggle-switch {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Body defaults */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Global select/dropdown styling for readability */
select {
    background-color: var(--bg-card);
    color: var(--text);
    padding-right: 28px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    color-scheme: dark;
}

select option {
    background-color: #1a1a2e;
    color: #eaeaea;
    padding: 8px;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: var(--accent);
    color: white;
}
