/* Game Tools Specific Styles - Extends styles.css */

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 15px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    border: 2px solid rgba(139, 111, 71, 0.3);
    border-radius: 12px;
    background: #f5ebe0;
    cursor: pointer;
    transition: all 0.3s;
    color: #6b4423;
    font-weight: 700;
    font-size: 1em;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.tab-btn:hover {
    background: #e8dcc8;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    background: linear-gradient(180deg, #4dd9cc 0%, #2ba89e 100%);
    color: white;
    border-color: #1d7a72;
    box-shadow: 0 4px 12px rgba(77, 217, 204, 0.4);
}

.tab-icon {
    font-size: 1.4em;
}

.tab-label {
    font-weight: 800;
}

/* Sub-Tab Navigation */
.sub-tab-navigation {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.sub-tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 15px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    color: #6b4423;
    font-weight: 600;
    font-size: 0.9em;
}

.sub-tab-btn:hover {
    background: #fff8f0;
    border-color: rgba(139, 111, 71, 0.4);
}

.sub-tab-btn.active {
    background: #ffd666;
    color: #6b4423;
    border-color: #d4a530;
    font-weight: 800;
}

/* Tab Content */
.tab-content-wrapper {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

.sub-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.sub-tab-content.active {
    display: block;
}

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

/* Tool Section - Match other sections */
.tool-section {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.tool-section h2 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0 0 20px 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 800;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-section h2::before {
    content: 'âš™ï¸';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 1;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.tool-section h2 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.tool-section > div {
    padding: 0 20px 20px 20px;
}

/* Calculator Sections */
.calculator-section {
    background: white;
    border: 2px solid rgba(139, 111, 71, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calculator-section h3 {
    color: #8b6914;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

.calculator-section h4 {
    color: #6b4423;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 700;
    color: #6b4423;
    font-size: 0.95em;
}

.calc-input {
    padding: 12px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    border-radius: 10px;
    font-size: 16px;
    background: #fff8f0;
    font-weight: 600;
    color: #4a3428;
    transition: all 0.3s;
}

.calc-input:focus {
    outline: none;
    border-color: #4dd9cc;
    box-shadow: 0 0 0 3px rgba(77, 217, 204, 0.2);
}

.calc-input:hover {
    border-color: rgba(139, 111, 71, 0.4);
}

/* Help Text */
.help-text {
    color: #8b7355;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 10px;
}

/* Tier Selection Buttons */
.tier-button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
}

.tier-select-btn {
    padding: 10px 15px;
    border: 2px solid rgba(139, 111, 71, 0.3);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    color: #6b4423;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tier-select-btn:hover {
    background: #fff8f0;
    border-color: rgba(139, 111, 71, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.tier-select-btn.active {
    background: linear-gradient(180deg, #ffd666 0%, #f4c542 100%);
    color: #6b4423;
    border-color: #d4a530;
    font-weight: 900;
    box-shadow: 0 3px 10px rgba(255, 214, 102, 0.4);
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #fff8f0 0%, #f5ebe0 100%);
    border: 2px solid rgba(139, 111, 71, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.results-section h3 {
    color: #8b6914;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

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

.result-card {
    background: white;
    border: 2px solid rgba(139, 111, 71, 0.2);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-card h4 {
    color: #6b4423;
    margin-bottom: 10px;
    font-size: 1em;
    text-align: center;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    padding-bottom: 8px;
}

.result-value {
    color: #4a3428;
    font-size: 1.1em;
    font-weight: 700;
    padding: 5px 0;
    text-align: center;
}

.result-value-large {
    color: #8b6914;
    font-size: 2em;
    font-weight: 900;
    text-align: center;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.result-value-small {
    color: #8b7355;
    font-size: 0.9em;
    font-weight: 600;
    padding: 5px 0;
    text-align: center;
    opacity: 0.8;
}

.result-note {
    color: #8b7355;
    font-size: 0.85em;
    text-align: center;
    margin-top: 5px;
    font-style: italic;
}

/* Promotion Calculator Specific */
.promotion-group {
    background: #fff8f0;
    border: 2px solid rgba(139, 111, 71, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.tier-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.input-group-small {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.input-group-small label {
    font-weight: 700;
    color: #6b4423;
    font-size: 0.85em;
    text-align: center;
}

.calc-input-small {
    padding: 8px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    font-weight: 600;
    color: #4a3428;
    text-align: center;
    transition: all 0.3s;
}

.calc-input-small:focus {
    outline: none;
    border-color: #4dd9cc;
    box-shadow: 0 0 0 2px rgba(77, 217, 204, 0.2);
}

/* Reverse Calculator Results */
.troop-tier-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.tier-result-card {
    background: white;
    border: 2px solid rgba(139, 111, 71, 0.2);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tier-result-card h5 {
    color: #8b6914;
    font-size: 0.95em;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(139, 111, 71, 0.15);
    padding-bottom: 5px;
}

.tier-result-value {
    color: #4a3428;
    font-size: 1.3em;
    font-weight: 800;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tab-navigation {
        padding: 8px;
        gap: 6px;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .tab-icon {
        font-size: 1.2em;
    }
    
    .sub-tab-navigation {
        padding: 6px;
        gap: 5px;
    }
    
    .sub-tab-btn {
        min-width: 80px;
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .tool-section h2 {
        padding: 12px 15px 12px 50px;
        font-size: 16px;
    }
    
    .tool-section h2::before {
        width: 45px;
        font-size: 20px;
    }
    
    .calculator-section {
        padding: 15px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .tier-input-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .result-value-large {
        font-size: 1.5em;
    }
    
    /* Promotion section mobile adjustments */
    .promotion-group {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .promotion-group h4 {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .input-group-small {
        min-width: 0;
    }
    
    .input-group-small label {
        font-size: 0.8em;
        white-space: nowrap;
    }
    
    .calc-input-small {
        padding: 8px 4px;
        font-size: 14px;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        min-width: auto;
        flex-direction: column;
        padding: 10px 8px;
        gap: 4px;
    }
    
    .tab-label {
        font-size: 0.75em;
        word-break: break-word;
        text-align: center;
    }
    
    .sub-tab-btn {
        font-size: 0.75em;
        padding: 6px 6px;
        min-width: 70px;
    }
    
    .tier-input-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    /* Extra small promotion adjustments */
    .promotion-group {
        padding: 8px;
    }
    
    .promotion-group h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .input-group-small label {
        font-size: 0.75em;
    }
    
    .calc-input-small {
        padding: 6px 3px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .tab-label {
        font-size: 0.7em;
    }
    
    .sub-tab-btn {
        font-size: 0.7em;
        padding: 5px 4px;
        min-width: 60px;
    }
    
    .tier-input-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .promotion-group {
        padding: 6px;
    }
    
    .input-group-small label {
        font-size: 0.7em;
    }
    
    .calc-input-small {
        padding: 5px 2px;
        font-size: 12px;
    }
}
