/* Build Calculator Page Specific Styles */

/* Calculator Hero Section */
.calculator-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 120px 0 80px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.calculator-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40">🧮</text></svg>') repeat;
    opacity: 0.1;
    animation: float 35s infinite linear;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Main Calculator Layout */
.calculator-main {
    padding: 4rem 0;
    background: var(--bg-alt);
}

.calculator-layout {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Panel Styles */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Plant Selection Panel */
.plant-selection-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.search-filter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.search-filter input,
.search-filter select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.plant-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
    max-height: 500px;
}

.plant-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

.plant-item:hover {
    border-color: var(--primary-color);
    background: rgba(46, 204, 113, 0.05);
    transform: translateX(5px);
}

.plant-item.selected {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
}

.plant-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.plant-info {
    flex: 1;
}

.plant-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.plant-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rarity {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rarity.legendary {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.rarity.epic {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.rarity.rare {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.rarity.uncommon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.rarity.common {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.cost {
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.add-plant-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition);
    flex-shrink: 0;
}

.add-plant-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.add-plant-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: scale(1);
}

/* Team Builder Panel */
.team-builder-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.team-slots-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.team-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.team-slot {
    aspect-ratio: 1;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    background: var(--bg-alt);
}

.team-slot:hover {
    border-color: var(--primary-color);
    background: rgba(46, 204, 113, 0.05);
}

.team-slot.occupied {
    border-style: solid;
    border-color: var(--secondary-color);
    background: white;
}

.team-slot.highlight {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

.slot-content {
    text-align: center;
    padding: 1rem;
}

.empty-slot-icon {
    font-size: 2rem;
    color: var(--border-color);
    margin-bottom: 0.5rem;
}

.slot-text {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.occupied-plant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.occupied-plant-icon {
    font-size: 2.5rem;
}

.occupied-plant-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark-color);
    text-align: center;
}

.remove-plant-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition);
}

.remove-plant-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Synergy Analysis */
.synergy-analysis {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 12px;
}

.synergy-analysis h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.synergy-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.synergy-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.synergy-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.synergy-text {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

.synergy-positive {
    border-left-color: #27ae60;
}

.synergy-negative {
    border-left-color: #e74c3c;
}

/* Stats Panel */
.stats-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

.team-stats {
    margin-bottom: 2rem;
}

.stat-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 12px;
}

.stat-group h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Composition Chart */
.team-composition {
    margin-bottom: 2rem;
}

.team-composition h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.composition-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

.bar-fill {
    height: 8px;
    background: var(--primary-color);
    border-radius: 4px;
    transition: var(--transition);
}

.bar-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dark-color);
    text-align: right;
}

/* Build Rating */
.build-rating {
    background: linear-gradient(135deg, var(--bg-alt), white);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.build-rating h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.rating-display {
    margin-bottom: 1rem;
}

.rating-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.rating-stars {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.star {
    color: #ddd;
    transition: var(--transition);
}

.star.filled {
    color: #ffd700;
}

.rating-description {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Recommended Builds Section */
.recommended-builds {
    padding: 4rem 0;
    background: white;
}

.recommended-builds h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.build-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
}

.build-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.build-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.build-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.build-rating-display {
    font-size: 1.2rem;
}

.build-composition {
    margin-bottom: 1.5rem;
}

.build-plants {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.build-plant {
    font-size: 2.5rem;
    padding: 0.5rem;
    background: var(--bg-alt);
    border-radius: 12px;
}

.build-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calculator-layout {
        grid-template-columns: 250px 1fr 300px;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .plant-selection-panel,
    .stats-panel {
        max-height: none;
    }

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

@media (max-width: 768px) {
    .calculator-hero h1 {
        font-size: 2rem;
    }

    .quick-actions {
        flex-direction: column;
        align-items: center;
    }

    .team-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .builds-grid {
        grid-template-columns: 1fr;
    }

    .search-filter {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .calculator-main {
        padding: 2rem 0;
    }

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

    .chart-bar {
        grid-template-columns: 60px 1fr 30px;
        gap: 0.5rem;
    }

    .quick-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-alt);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .calculator-hero,
    .recommended-builds,
    .footer {
        display: none;
    }

    .calculator-main {
        background: white;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .build-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}