/* Basketball Tools Shared Styles */

/* 
   REQUIRES: The following variables to be defined in the parent scope (:root)
   --tool-primary
   --tool-primary-dark
   --tool-bg
   --tool-card-bg
   --tool-text
   --tool-text-muted
*/

/* Layout & Typography */
.dunk-container, .efg-container, .gs-container, .ts-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    padding: 0 1rem;
}

.dunk-header, .efg-header, .gs-header, .ts-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dunk-title, .efg-title, .gs-title, .ts-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.dunk-subtitle, .efg-subtitle, .gs-subtitle, .ts-subtitle {
    color: var(--tool-text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Card */
.dunk-card, .efg-card, .gs-card, .ts-card {
    background: var(--tool-card-bg);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

/* Card Background Glow - Helper Class */
.tool-bg-glow {
    position: absolute; 
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%; 
    z-index: 1;
    pointer-events: none;
}

/* Inputs Section */
.dunk-inputs, .efg-inputs, .gs-inputs, .ts-inputs {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    z-index: 2;
}

.dunk-input-group label, .efg-input-group label, .gs-input-group label, .ts-input-group label {
    display: block;
    color: var(--tool-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Grid Layouts for Inputs */
.dunk-unit-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.efg-input-grid, .gs-input-grid, .ts-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default to 3, can override */
    gap: 1rem;
}

.gs-input-section-title {
    color: var(--tool-primary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}

/* Input Fields */
.dunk-input, .dunk-select, .efg-input, .gs-input, .ts-input {
    width: 100%;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.gs-input { padding: 0.75rem; font-size: 1rem; border-radius: 8px; } /* Slightly smaller for GS */

.dunk-input:focus, .dunk-select:focus, .efg-input:focus, .gs-input:focus, .ts-input:focus {
    outline: none;
    border-color: var(--tool-primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1); /* Generic fallback, specific color via inline var if needed or acceptable generic */
}

/* Buttons */
.dunk-btn, .efg-btn, .gs-btn, .ts-btn {
    background: linear-gradient(135deg, var(--tool-primary) 0%, var(--tool-primary-dark) 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.dunk-btn:hover, .efg-btn:hover, .gs-btn:hover, .ts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dunk-btn:active, .efg-btn:active, .gs-btn:active, .ts-btn:active {
    transform: translateY(0);
}

/* Results Section */
.dunk-results, .efg-results, .gs-results, .ts-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.dunk-score-circle, .efg-score-circle, .gs-score-circle, .ts-score-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: conic-gradient(var(--tool-primary) 0%, #334155 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    transition: background 1s ease-out;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}

.dunk-score-circle::before, .efg-score-circle::before, .gs-score-circle::before, .ts-score-circle::before {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    background: var(--tool-card-bg);
    border-radius: 50%;
}

.dunk-score-content, .efg-score-content, .gs-score-content, .ts-score-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dunk-score-value, .efg-score-value, .gs-score-value, .ts-score-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    letter-spacing: -0.05em;
}

.dunk-score-label, .efg-score-label, .gs-score-label, .ts-score-label {
    font-size: 0.9rem;
    color: var(--tool-text-muted);
    text-transform: uppercase;
    margin-top: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.dunk-rating-badge, .efg-rating-badge, .gs-rating-badge, .ts-rating-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tool-text);
    margin-top: 1rem;
}

/* Specific Sub-stats */
.efg-substats {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.efg-stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
}

.efg-stat-val { font-weight: 700; font-size: 1.1rem; color: white; }
.efg-stat-lbl { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }

.dunk-gap, .ts-poss {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Comparison Bars (Shared) */
.tool-comparison, .efg-comparison, .gs-comparison, .ts-comparison {
    margin-top: 2rem;
    width: 100%;
}

.tool-bar-group, .efg-bar-group, .gs-bar-group, .ts-bar-group {
    margin-bottom: 1.5rem;
}

.tool-bar-header, .efg-bar-header, .gs-bar-header, .ts-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--tool-text-muted);
    font-weight: 500;
}

.tool-bar-track, .efg-bar-track, .gs-bar-track, .ts-bar-track {
    height: 10px;
    background: #334155;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.tool-bar-fill, .efg-bar-fill, .gs-bar-fill, .ts-bar-fill {
    height: 100%;
    background: var(--tool-primary);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 5px;
}

/* Info Sections */
.dunk-content-wrapper, .efg-content-wrapper, .gs-content-wrapper, .ts-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.dunk-info-section, .efg-info-section, .gs-info-section, .ts-info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dunk-info-card, .efg-info-card, .gs-info-card, .ts-info-card {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.2s, border-color 0.2s;
}

.dunk-info-card:hover, .efg-info-card:hover, .gs-info-card:hover, .ts-info-card:hover {
    transform: translateY(-5px);
    border-color: var(--tool-primary);
}

.dunk-info-title, .efg-info-title, .gs-info-title, .ts-info-title {
    color: var(--tool-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dunk-info-text, .efg-info-text, .gs-info-text, .ts-info-text {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.dunk-text-block h2, .efg-text-block h2, .gs-text-block h2, .ts-text-block h2 {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.dunk-text-block p, .efg-text-block p, .gs-text-block p, .ts-text-block p {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Tables */
.tool-table-container, .dunk-table-container {
    overflow-x: auto;
    background: var(--tool-card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.tool-table, .dunk-height-table {
    width: 100%;
    border-collapse: collapse;
    color: #cbd5e1;
    min-width: 500px;
}

.tool-table th, .dunk-height-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
    color: var(--tool-primary);
}

.tool-table td, .dunk-height-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Error Field */
.field-error {
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 500;
}
.error-field {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Responsive */
@media (max-width: 900px) {
    .dunk-card, .efg-card, .gs-card, .ts-card {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }
    .dunk-content-wrapper, .efg-content-wrapper, .gs-content-wrapper, .ts-content-wrapper {
        grid-template-columns: 1fr;
    }
    .dunk-inputs, .efg-inputs, .gs-inputs, .ts-inputs {
        gap: 1.5rem;
    }
    .efg-input-grid, .gs-input-grid, .ts-input-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dunk-score-circle, .efg-score-circle, .gs-score-circle, .ts-score-circle {
        width: 180px;
        height: 180px;
    }
    .dunk-score-circle::before, .efg-score-circle::before, .gs-score-circle::before, .ts-score-circle::before {
        width: 150px;
        height: 150px;
    }
    .dunk-score-value, .efg-score-value, .gs-score-value, .ts-score-value {
        font-size: 2.5rem;
    }
}
