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

:root {
    --primary-color: #e65100;
    --primary-dark: #bf360c;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.logo {
    margin-bottom: 24px;
}

.basketball-icon {
    font-size: 64px;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.tagline {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 16px;
}

.login-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    min-height: 44px;
    min-width: 44px;
}

.login-btn:hover {
    background-color: var(--primary-dark);
}

.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.logout-btn {
    background-color: transparent;
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--primary-color);
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
}

.logout-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.workout-header {
    margin-bottom: 24px;
}

.workout-header h2 {
    font-size: 24px;
    color: var(--text-color);
}

.drills-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.drill-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

.drill-card:hover {
    box-shadow: var(--shadow-hover);
}

.drill-card.ai-generated {
    border-left: 4px solid var(--primary-color);
}

.drill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.drill-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.drill-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.duration,
.target-makes {
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.target-makes {
    background-color: #fff3e0;
    color: var(--primary-color);
}

.drill-description {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.6;
}

.coaching-points {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    padding-left: 16px;
    border-left: 3px solid var(--primary-color);
}

.workout-summary {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 24px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .main-content {
        padding: 16px;
    }

    .workout-header h2 {
        font-size: 20px;
    }

    .drill-card {
        padding: 20px;
    }

    .drill-header {
        flex-direction: column;
    }

    .drill-name {
        font-size: 18px;
    }

    .workout-summary {
        flex-direction: column;
        gap: 16px;
    }

    .summary-value {
        font-size: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        padding: 32px;
    }

    .drill-card {
        padding: 28px;
    }
}

.generator-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.generator-title {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.generator-subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.form-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 12px;
}

.duration-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.radio-card {
    cursor: pointer;
}

.radio-card input {
    display: none;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #ddd;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.radio-card input:checked + .radio-card-content {
    border-color: var(--primary-color);
    background-color: #fff3e0;
}

.duration-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.duration-label {
    font-size: 12px;
    color: var(--text-muted);
}

.focus-group {
    margin-bottom: 16px;
}

.focus-group:last-child {
    margin-bottom: 0;
}

.focus-group-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.focus-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.checkbox-card {
    cursor: pointer;
    display: flex;
}

.checkbox-card input {
    display: none;
}

.checkbox-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    transition: all 0.2s ease;
    height: 64px;
    width: 100%;
}

.checkbox-card input:checked + .checkbox-card-content {
    border-color: var(--primary-color);
    background-color: #fff3e0;
}

.checkbox-indicator {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-card input:checked + .checkbox-card-content .checkbox-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.checkbox-card input:checked + .checkbox-card-content .checkbox-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.checkbox-card .label {
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

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

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    width: 100%;
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.workout-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.workout-stats {
    display: flex;
    gap: 24px;
}

.stat {
    font-size: 18px;
    font-weight: 500;
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 20px;
}

.drill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

.drill-header h3 {
    flex: 1;
    margin: 0;
}

.drill-category {
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.difficulty {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.coaching-points {
    background: #fff8e1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    border-left: none;
    font-style: normal;
    color: var(--text-color);
}

.workout-footer {
    background: #333;
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
}

.totals {
    display: flex;
    justify-content: space-around;
    font-size: 18px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .duration-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .focus-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .generator-container {
        padding: 24px;
    }

    .totals {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .workout-title-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

.ai-toggle-group {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-container input {
    display: none;
}

.toggle-slider {
    width: 56px;
    height: 30px;
    background: #444;
    border-radius: 15px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-container input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-container input:checked + .toggle-slider::after {
    transform: translateX(26px);
}

.toggle-label {
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.toggle-description {
    color: #aaa;
    font-size: 14px;
    margin-top: 8px;
    margin-left: 68px;
}


.ai-instructions textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.ai-instructions textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.ai-instructions textarea::placeholder {
    color: #999;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.recent-section {
    margin-top: 32px;
}

.recent-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-card {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    transition: border-color 0.2s;
}

.recent-card:hover {
    border-color: var(--primary-color);
}

.recent-name {
    font-weight: 500;
}

.recent-meta {
    color: var(--text-muted);
    font-size: 14px;
}

.ai-badge {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.coach-notes {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
    border-left: 4px solid var(--primary-color);
}

.coach-notes h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.coach-notes p {
    margin: 0;
    line-height: 1.6;
}

.drill-notes {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    color: #1565c0;
}

.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    max-width: 480px;
    padding: 40px;
    width: 100%;
}

.loading-basketball {
    position: relative;
    height: 120px;
    margin-bottom: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.basketball-bounce {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.basketball-shadow {
    position: absolute;
    bottom: 0;
    width: 50px;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: shadow-pulse 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    50% {
        transform: translateY(-50px);
        animation-timing-function: ease-in;
    }
}

@keyframes shadow-pulse {
    0%, 100% {
        transform: scaleX(1);
        opacity: 0.3;
    }
    50% {
        transform: scaleX(0.6);
        opacity: 0.1;
    }
}

.loading-title {
    color: white;
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.loading-status {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    margin-bottom: 32px;
    min-height: 24px;
    transition: opacity 0.2s ease;
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 40px;
}

.loading-progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.loading-tips {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px 24px;
    border-left: 3px solid var(--primary-color);
}

.loading-tip-label {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.loading-tip-text {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    line-height: 1.6;
    transition: opacity 0.3s ease;
    margin: 0;
}

@media (max-width: 600px) {
    .loading-content {
        padding: 24px;
    }

    .loading-title {
        font-size: 20px;
    }

    .loading-status {
        font-size: 14px;
    }
}

.dev-banner {
    background: #ff9800;
    color: #fff;
    text-align: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 1000;
}
