/* Base Styles */
body { 
    background: #f5f5f5; 
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
}

/* Container */
.container {
    max-width: 90%;
    margin: 20px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 32px;
    position: relative;
    z-index: 1;
}
h1 { 
    text-align: center; 
    color: #1976d2; 
    margin-bottom: 24px;
    font-size: 2em;
    font-weight: bold;
}
/* Drill Card */
.drill { 
    margin-bottom: 30px;
    position: relative;
    padding: 0;
    background: #fff;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.drill:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}
.drill:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}
/* Drill Header */
.drill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    z-index: 2;
}

/* Drill meta badges (duration, equipment) */
.drill-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #0b0b0b;
    border: 1px solid #c7d2fe;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
/* Category Navigation */
.category-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 30px;
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.category-nav a {
    padding: 12px 20px;
    text-decoration: none;
    color: #000000 !important; /* pure black for maximum contrast */
    font-weight: 800;
    font-size: 18px;
    border-radius: 22px;
    transition: all 0.2s ease;
    background: #ffffff;
    border: 1px solid #d1d5db;
    letter-spacing: 0.2px;
}

.category-nav a:hover {
    background: #e8f1fd;
    border-color: #90caf9;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.category-nav a.active {
    background: #1565c0;
    color: #ffffff !important;
    border-color: #1565c0;
    box-shadow: 0 6px 14px rgba(21,101,192,0.25);
}

/* Focus visibility for keyboard users */
.category-nav a:focus-visible {
    outline: 3px solid #90caf9;
    outline-offset: 2px;
}

/* Ensure visited links remain dark */
.category-nav a:visited {
    color: #000000 !important;
}

/* Home page header nav styling */
header nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 10px 0 20px;
}

header nav a {
    padding: 10px 16px;
    text-decoration: none;
    color: #000000 !important; /* pure black */
    font-weight: 800;
    font-size: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

header nav a:hover {
    background: #e8f1fd;
    border-color: #90caf9;
    color: #000000 !important;
}

header nav a.active {
    background: #1565c0;
    color: #ffffff;
    border-color: #1565c0;
}

/* Ensure visited links in header remain dark */
header nav a:visited {
    color: #000000 !important;
}

/* Shared header wrapper for all pages */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 20px 0;
    padding: 10px 0 0;
}

.main-header h1 {
    margin: 0;
    font-weight: 800;
    color: #1f2937; /* dark text */
}

@media (max-width: 768px) {
    .main-header {
        gap: 10px;
    }
}

/* Unified category nav (applies to all pages) */
header.main-header .category-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

header.main-header .category-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    color: #2d3748 !important;
    text-decoration: none;
    font-weight: 700;
    transition: all .25s cubic-bezier(.4,0,.2,1);
}

header.main-header .category-nav a:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

header.main-header .category-nav a.active {
    background: #2b6cb0 !important;
    color: #fff !important;
    border-color: #2b6cb0 !important;
}

header.main-header .category-nav a:focus-visible {
    outline: 2px solid #94c0ff;
    outline-offset: 2px;
}

.drill-title { 
    color: #1a237e;
    font-size: 1.4em;
    margin: 0;
    cursor: pointer;
    padding: 8px 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.2s ease;
    flex-grow: 1;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drill-title:hover {
    color: #0d47a1;
    transform: translateX(4px);
}
.start-animation-btn {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-animation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.start-animation-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

/* Drill Description */
.drill-description {
    display: none;
    padding: 0;
    background: #fff;
    overflow: hidden;
    position: relative;
}

.drill-content {
    padding: 24px;
}

.drill-content h3 {
    color: #1a237e;
    margin-bottom: 16px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drill-content h4 {
    color: #3949ab;
    margin: 16px 0 8px;
    font-size: 1.1em;
}

.drill-content p {
    margin: 0 0 16px;
    color: #37474f;
    line-height: 1.6;
}

.coach-points,
.player-points,
.drill-instructions,
.progression {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1976d2;
}

.coach-points {
    background: #e3f2fd;
    border-left-color: #1976d2;
}

.player-points {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.progression {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

.skill-category {
    margin-bottom: 16px;
}

.skill-category:last-child {
    margin-bottom: 0;
}

ul, ol {
    padding-left: 20px;
    margin: 8px 0;
}

ul li, ol li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 24px;
}

ul li:before {
    content: '•';
    color: #1976d2;
    font-weight: bold;
    position: absolute;
    left: 0;
}

ol {
    counter-reset: item;
}

ol li {
    counter-increment: item;
}

ol li:before {
    content: counter(item) '.';
    color: #1976d2;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.development-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

/* Close Button */
.close-description {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-description:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* SVG Styling */
.drill svg {
    width: 100%;
    height: auto;
    max-height: 500px;
    background: #4caf50;
    border-radius: 0 0 16px 16px;
    display: block;
    margin: 0;
    border-top: 1px solid #e9ecef;
}

/* Player and Ball Styling */
.player {
    transition: all 0.3s ease;
    cursor: pointer;
}

.player.attacker {
    fill: #ff5722;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.player.server {
    fill: #2196f3;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.player.goalkeeper {
    fill: #9c27b0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.player.defender {
    fill: #f44336;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.ball {
    fill: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: all 0.2s ease-out;
}

/* Field Markings */
.field-line {
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

.goal {
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

/* Animation Elements */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.animated {
    animation: pulse 1s infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .drill-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .start-animation-btn {
        width: 100%;
        justify-content: center;
    }
    
    .development-grid {
        grid-template-columns: 1fr;
    }
}
.drill-description { 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 8px 32px rgba(25,118,210,0.1);
    width: 95%;
    max-width: 600px;
    z-index: 1000;
    display: none;
    max-height: 85vh;
    overflow-y: auto;
    border: 3px solid #1976d2;
    animation: slideInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.drill-description.active {
    display: block;
}
@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
.drill-description h3 { 
    color: #1976d2; 
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(25,118,210,0.1);
    border-bottom: 3px solid #e3f2fd;
    padding-bottom: 15px;
}

.drill-description .objective { 
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #1976d2;
    box-shadow: 0 4px 15px rgba(25,118,210,0.1);
}

.drill-description .objective strong {
    color: #1976d2;
    font-size: 1.1em;
    display: block;
    margin-bottom: 8px;
}

.drill-description .section {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.drill-description .section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.drill-description .section-title {
    color: #1976d2;
    font-weight: 600;
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drill-description .section-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border-radius: 2px;
}

.drill-description p { 
    margin-bottom: 15px; 
    line-height: 1.7;
    font-size: 1.05em;
    color: #424242;
}

.drill-description ul { 
    margin: 15px 0; 
    padding-left: 0;
    list-style: none;
}

.drill-description ul li { 
    margin-bottom: 12px;
    font-size: 1.05em;
    color: #555;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.drill-description ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.2em;
}

.drill-description ol {
    margin: 15px 0;
    padding-left: 0;
    counter-reset: step-counter;
}

.drill-description ol li {
    margin-bottom: 15px;
    font-size: 1.05em;
    color: #555;
    padding-left: 40px;
    position: relative;
    line-height: 1.6;
    counter-increment: step-counter;
}

.drill-description ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}
/* Backdrop overlay */
.drill-description::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    backdrop-filter: blur(5px);
}

.close-description { 
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    color: #666;
    font-size: 2em;
    font-weight: bold;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.close-description:hover {
    color: #fff;
    background: #f44336;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(244,67,54,0.3);
}
svg { 
    display: block; 
    margin: 0 auto; 
    background: #4caf50;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: visible;
    width: 100%;
    height: 400px;
    min-height: 200px;
}
.player { 
    fill: #1976d2; 
    stroke: #fff; 
    stroke-width: 3;
}

/* Style for the defender in Drill 6 */
#overlap-player3 {
    fill: #f44336 !important;  /* Player color-coding */
    stroke: #fff;
    stroke-width: 3;
}

.defender {
  /* Works for SVG shapes (e.g., circle, rect) */
  fill: #1976d2 !important; /* blue */
  stroke: #0f4fa3 !important;
}
.attacker {
  fill: #e53935 !important; /* red */
  stroke: #b71c1c !important;
}

/* If players are groups <g>, color inner shapes */
g.defender * {
  fill: #1976d2 !important;
  stroke: #0f4fa3 !important;
}
g.attacker * {
  fill: #e53935 !important;
  stroke: #b71c1c !important;
}

/* Style for the defender in Drill 7 */
#rondo-defender {
    fill: #f44336 !important;  /* Red color for the defender */
    stroke: #fff;
    stroke-width: 3;
}

.ball { 
    fill: #fff; 
    stroke: #222; 
    stroke-width: 2;
}
.pass-line { 
    stroke: #1976d2; 
    stroke-width: 2; 
    stroke-dasharray: 5;
}

#P13-animation svg, #P14-animation svg {
    display: block;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.defender {
    fill: #f44336;
    stroke: #fff;
    stroke-width: 2;
}

.grid {
    stroke: #e0e0e0;
    stroke-dasharray: 5,5;
}

text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}

.drill-animation {
    margin: 20px 0;
    text-align: center;
    overflow: visible;
}

/* Defender styles */
.defender {
    fill: #f44336; /* Red color for defender */
    stroke: #b71c1c;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.defender:hover {
    fill: #d32f2f;
    transform: scale(1.1);
    cursor: pointer;
}

/* Make sure the defender is visible on top of other elements */
#defender1 {
    z-index: 10;
}

/* Drill animation container */
.drill-svg-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #4CAF50;
    position: relative;
}

/* Ensure SVG scales properly */
svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
}

/* Player elements */
.player {
    transition: transform 0.3s ease;
}

.player text {
    pointer-events: none;
    user-select: none;
}

/* Ball animation */
.ball {
    transition: transform 0.3s ease;
    will-change: transform;
}

/* DF9: Pressing Triggers */
#DF9 .drill-svg-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    background-color: #4CAF50;
    border-radius: 5px;
}

#DF9-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Pressing trigger text */
#df9-trigger-text {
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .drill-svg-container {
        border-radius: 0;
        margin: 0 -20px;
        width: calc(100% + 40px);
    }
    
    svg {
        max-height: 400px;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .container { 
        max-width: 800px;
        padding: 40px;
    }
    .drill { 
        margin-bottom: 40px;
        padding: 25px;
    }
    .drill-title { 
        font-size: 1.5em;
        padding: 12px 20px;
    }
    svg { 
        height: 500px;
    }
}

@media (min-width: 1200px) {
    .container { 
        padding: 60px;
    }
    .drill { 
        margin-bottom: 60px;
    }
    .drill-title { 
        font-size: 1.8em;
    }
    svg { 
        height: 600px;
    }
}
