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

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #06B6D4;
    --dark: #0F172A;
    --light: #F8FAFC;
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 2px 10px rgba(0,0,0,0.06);
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
    
    /* Light mode colors (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #F9FAFB;
    --text-primary: #0F172A;
    --text-secondary: #4B5563;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --border-color: #E2E8F0;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #1F2937;
    --bg-secondary: #111827;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --card-bg: #374151;
    --input-bg: #1F2937;
    --border-color: #374151;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.2);
    --light: #374151;
    --border: #4B5563;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #cffafe 100%);
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    transition: color 0.3s ease;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Mobile-first container */
.container {
    max-width: 100%;
    margin: 0;
    background: var(--bg-primary);
    min-height: 100vh;
    transition: background 0.3s ease;
}

/* Header - Mobile First */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

[data-theme="dark"] header {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
}

/* Vanta canvas positioning */
header canvas {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 0;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: 1;
}

header::after {
    content: '🏒';
    position: absolute;
    font-size: 8rem;
    opacity: 0.02;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
}

.header-content {
    position: relative;
    z-index: 2;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    font-family: 'Arial Black', sans-serif;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: #ffffff;
    font-family: 'Helvetica Neue', sans-serif;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #cbd5e1;
}

/* Main content - Mobile First */
.main-content {
    padding: 1rem;
    padding-bottom: 2rem;
}

/* Ticket type selector */
.ticket-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.type-btn:active {
    transform: scale(0.98);
}

.type-btn.active {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.type-btn.active::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.type-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.type-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

.type-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.type-btn.active .type-name {
    color: var(--primary);
}

.type-btn.active .type-count {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Section cards */
.section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.section h2 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Input groups - Mobile First */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: all 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.input-group button:active {
    transform: scale(0.98);
}

.input-group button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Ticket display */
.ticket-count {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    text-align: center;
}

.ticket-list {
    min-height: 80px;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.ticket-item {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* Buttons */
.ticket-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    padding: 0.625rem 1.25rem;
    background: var(--info);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #2563EB;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.active {
    background: var(--success);
}

.action-btn.active:hover {
    background: #059669;
}

.clear-btn {
    flex: 1;
    padding: 0.625rem 1.25rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Button icon styles */
.btn-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.clear-btn:active {
    transform: scale(0.98);
}

.remove-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #FEF3C7;
    border-radius: 8px;
    border: 2px solid #FCD34D;
}

.remove-btn {
    background: var(--warning);
    color: white;
}

.remove-btn:hover {
    background: #D97706;
}

/* Removable ticket items */
.ticket-item.removable {
    cursor: pointer;
    position: relative;
    background: var(--danger);
    transition: all 0.2s;
    padding-right: 1.5rem;
}

.ticket-item.removable:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.remove-x {
    position: absolute;
    right: 0.5rem;
    font-weight: bold;
    font-size: 1.2rem;
}

.check-btn {
    background: var(--success);
}

.check-btn:hover {
    background: #059669;
}

/* Results display */
.result {
    margin-top: 1rem;
}

.winner {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    animation: slide-up 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.winner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 2s infinite;
}

.not-winner {
    background: #FEE2E2;
    color: var(--danger);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #FECACA;
    animation: slide-up 0.3s ease-out;
}

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

@keyframes shine {
    0% { transform: rotate(0deg) translateX(-100%); }
    100% { transform: rotate(0deg) translateX(100%); }
}

/* Image upload section */
.image-upload-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border);
}

.image-upload-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    cursor: pointer;
}

.upload-area:hover {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-color: var(--primary-dark);
}

.upload-area.dragover {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border-color: var(--info);
    transform: scale(0.98);
}

.upload-label {
    display: block;
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
}

/* OCR status */
.ocr-status {
    margin-top: 1rem;
    text-align: center;
}

.ocr-status .loading {
    color: var(--primary);
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

.ocr-status .success {
    color: var(--success);
    font-weight: 600;
}

.ocr-status .error {
    color: var(--danger);
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Extracted numbers */
.extracted-numbers {
    margin-top: 1rem;
}

.extracted-numbers h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.extracted-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.extracted-num {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--info);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    cursor: help;
    transition: all 0.2s;
}

.extracted-num:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Confidence level styling */
.extracted-num.high-conf {
    background: var(--success);
}

.extracted-num.med-conf {
    background: var(--warning);
}

.extracted-num.low-conf {
    background: var(--danger);
    opacity: 0.9;
}

.conf-indicator {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0.8;
}

/* Detected ranges display */
.detected-ranges {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--light);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
}

.detected-ranges p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* OCR Tips Section */
.ocr-tips {
    margin: 1rem 0;
}

.ocr-tips details {
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.ocr-tips summary {
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    user-select: none;
    font-size: 0.9rem;
}

.ocr-tips summary::-webkit-details-marker {
    color: var(--primary);
}

.ocr-tips details[open] {
    background: var(--card-bg);
    border-color: var(--primary);
}

.ocr-tips ul {
    margin: 0.75rem 0 0 0;
    padding-left: 1.5rem;
}

.ocr-tips li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Bulk results */
.bulk-results {
    margin-top: 1rem;
}

.bulk-results h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.bulk-winners, .bulk-not-winners {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    animation: slide-up 0.3s ease-out;
}

.bulk-winners {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 2px solid var(--success);
    position: relative;
}

.trophy-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: trophy-bounce 0.6s ease-out;
}

@keyframes trophy-bounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.bulk-winners h4 {
    color: #065F46;
    margin-bottom: 0.75rem;
    text-align: center;
    font-weight: 700;
}

.bulk-not-winners {
    background: #FEE2E2;
    border: 2px solid #FECACA;
}

.bulk-not-winners h4 {
    color: var(--danger);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.winning-numbers, .losing-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.win-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.5rem 0.75rem;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

.animate-win {
    animation: winner-pop 0.5s ease-out forwards;
    display: inline-block;
}

@keyframes winner-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.lose-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.5rem 0.75rem;
    background: white;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* History */
.history {
    max-height: 250px;
    overflow-y: auto;
    background: var(--light);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--card-bg);
    transition: background 0.3s ease;
}

.winner-history {
    border-left: 3px solid var(--success);
}

.loser-history {
    border-left: 3px solid var(--danger);
}

.history-number {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-result {
    flex: 1;
    text-align: center;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-multiple {
    flex: 1;
}

.history-header {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.history-winners {
    color: var(--success);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.history-losers {
    color: var(--danger);
    font-size: 0.85rem;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: transform 0.3s;
    z-index: 1000;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification-info {
    background: var(--info);
}

.notification-success {
    background: var(--success);
}

.notification-warning {
    background: var(--warning);
}

.notification-error {
    background: var(--danger);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    margin-top: 3rem;
    padding: 2rem 1rem 1rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.footer-content {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    font-size: 0.9rem;
    padding: 0.25rem 0;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    padding-left: 1.25rem;
}

.footer-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.9rem;
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.8);
}

.footer-note {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.footer-link:hover {
    color: white;
    border-bottom-color: white;
}

/* Privacy Policy Page Styles */
.policy-nav {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--primary-dark);
    transform: translateX(-2px);
}

.policy-section {
    background: var(--card-bg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.policy-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.policy-section h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.policy-section h4 {
    color: var(--primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.policy-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.policy-section ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.policy-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.policy-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem !important;
}

.cookie-table {
    margin: 1.5rem 0;
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.cookie-table th {
    background: var(--light);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.cookie-table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.cookie-table tr:hover {
    background: var(--light);
}

.policy-section a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary);
}

.policy-section a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

/* Theme toggle button styles */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    color: white;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.theme-icon-light {
    display: block;
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .theme-toggle {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transition: bottom 0.3s ease;
    z-index: 1000;
}

.install-banner.show {
    bottom: 0;
}

.install-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.install-text {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.install-btn {
    padding: 0.5rem 1.5rem;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.dismiss-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mobile install banner adjustments */
@media (max-width: 640px) {
    .install-content {
        padding: 0 0.5rem;
    }
    
    .install-text {
        font-size: 0.85rem;
    }
    
    .install-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* iOS Install Guide */
.ios-install-guide {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(300px);
    width: 90%;
    max-width: 340px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid var(--primary);
}

.ios-install-guide.show {
    transform: translateX(-50%) translateY(0);
}

.ios-guide-content {
    position: relative;
}

.ios-guide-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.ios-guide-close:hover {
    transform: rotate(90deg);
    background: #DC2626;
}

.ios-guide-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.ios-share-icon {
    flex-shrink: 0;
}

.ios-guide-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ios-guide-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.ios-guide-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ios-guide-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.inline-icon {
    margin-left: 0.25rem;
    vertical-align: middle;
    color: var(--primary);
}

.icon-plus {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: bold;
}

/* Arrow pointing down to Safari controls */
.ios-guide-arrow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--card-bg);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.1));
}

.ios-guide-arrow::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -12px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--primary);
}

/* Dark mode adjustments */
[data-theme="dark"] .ios-install-guide {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .ios-guide-arrow {
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

/* Animation for the guide */
@keyframes bounce-in {
    0% {
        transform: translateX(-50%) translateY(300px) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-10px) scale(1.02);
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

.ios-install-guide.show {
    animation: bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Adjust for smaller screens */
@media (max-width: 380px) {
    .ios-install-guide {
        width: 95%;
        padding: 1rem;
        bottom: 10px;
    }
    
    .ios-guide-text {
        font-size: 0.85rem;
    }
    
    .ios-guide-steps li {
        font-size: 0.85rem;
    }
}

/* Install Guide Page Styles */
.install-hero {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.install-hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.install-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.install-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.benefit-icon {
    font-size: 2rem;
}

.platform-message {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

[data-theme="dark"] .platform-message {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

.platform-message p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ios-detected {
    border-color: #007AFF;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.android-detected {
    border-color: #34A853;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.desktop-detected {
    border-color: var(--primary);
}

[data-theme="dark"] .ios-detected,
[data-theme="dark"] .android-detected {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

.install-section {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.install-section.highlighted {
    box-shadow: 0 0 0 3px var(--primary);
}

.install-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.install-steps {
    display: grid;
    gap: 1.5rem;
}

.step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-column: 1 / -1;
}

.step-badge {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.step p {
    grid-column: 2;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-visual {
    grid-column: 2;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    height: 80px;
}

.install-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.browser-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.browser-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.browser-tab:hover {
    color: var(--text-primary);
}

.browser-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.browser-content h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.troubleshoot-items {
    display: grid;
    gap: 1rem;
}

.troubleshoot-items details {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.troubleshoot-items summary {
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    user-select: none;
}

.troubleshoot-items summary::-webkit-details-marker {
    color: var(--primary);
}

.troubleshoot-items details[open] {
    background: var(--card-bg);
}

.troubleshoot-items details p {
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cta-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Mobile adjustments for install guide */
@media (max-width: 640px) {
    .install-hero h1 {
        font-size: 1.5rem;
    }
    
    .install-benefits {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .step {
        padding: 1rem;
    }
    
    .browser-tabs {
        overflow-x: auto;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet and Desktop */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
        margin: 2rem auto;
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
        min-height: auto;
    }
    
    header {
        border-radius: 20px 20px 0 0;
        padding: 3rem 2.5rem;
    }
    
    .logo-number {
        font-size: 3.5rem;
    }
    
    .logo-text {
        font-size: 3.5rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    footer {
        border-radius: 0 0 20px 20px;
        padding: 3rem 2rem 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 3rem;
        max-width: 1200px;
        margin: 0 auto 2rem;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .input-group {
        flex-direction: row;
    }
    
    .input-group input {
        flex: 1;
    }
    
    .input-group button {
        width: auto;
    }
    
    .clear-btn {
        width: auto;
    }
    
    .ticket-actions {
        flex-direction: row;
    }
    
    .upload-area {
        padding: 3rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }
    
    body {
        padding: 2rem;
    }
}