/* MyDailyWin Shared Styles */

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #58cc02;
    --primary-dark: #58a700;
    --primary-shade: #46a302;
    --secondary: #2b70c9;
    --secondary-shade: #184a8c;
    --accent: #ffc800;
    --accent-shade: #e5a400;
    --danger: #ff4b4b;
    --danger-shade: #d33131;
    --purple: #ce82ff;
    --purple-shade: #a546e0;
    --orange: #ff9600;
    --bg: #f7f7f7;
    --card-bg: #ffffff;
    --text: #3c3c3c;
    --text-light: #595959;
    --radius-box: 20px;
    --radius-btn: 16px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== ACCESSIBILITY ========== */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 10px;
}

/* Focus indicators */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Keyboard navigation - remove focus ring for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ========== TOUCH TARGETS ========== */

/* Minimum 44x44px touch targets for accessibility */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon button base - 44x44px minimum */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.12);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    min-height: 48px;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

/* ========== FORM ELEMENTS ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    min-height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: #f9fafb;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.15);
}

/* Prevent zoom on iOS when focusing inputs */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* ========== CARDS ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-box);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ========== CONTAINER ========== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== UTILITY CLASSES ========== */

/* Screen reader only - visually hidden but accessible */
.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;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== LOADING STATES ========== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.8s linear infinite;
}

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

/* ========== LAZY LOADING ========== */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Image placeholder while loading */
.img-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
