/* Dart Game - Main Styles */

:root {
    --primary-color: #3730a3; /* indigo-800 - matches page gradient */
    --primary-dark: #312e81;  /* indigo-900 - matches page gradient end */
    --secondary-color: #94a3b8; /* slate-300 */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a; /* slate-900 */
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
    min-height: 100vh;
    color: #334155;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: transparent; /* let page background show */
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

header::before {
    display: none;
}

header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
}

/* Card enhancements */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: none;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.card-body {
    padding: 2rem;
}

/* Button enhancements */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4);
}

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

/* Form enhancements */
.form-control {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 1.5rem 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Harmonize Bootstrap utility classes with theme */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }

/* Pretty checkbox styling */
.pretty-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.25rem;
    accent-color: var(--primary-color);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.2s ease;
}

.pretty-checkbox:hover {
    transform: scale(1.05);
}

.pretty-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
    outline: none;
}

/* Flash animation for last scored points */
.score-flash {
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translateX(-50%);
    z-index: 2000;
    font-size: 4rem;
    font-weight: 800;
    color: #0a0239; /* dark text for white cards */
    /* light outline + subtle halo for contrast on white */
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95),
        0 0 10px rgba(255, 255, 255, 0.45),
        0 6px 18px rgba(0, 0, 0, 0.15);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    animation: scoreFlash 1s ease-out forwards;
}

@keyframes scoreFlash {
    0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.85); }
    10%  { opacity: 1; transform: translate(-50%, 0) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -10px) scale(1.1); }
}
