/* Tutorial UI styles */

/* Popup and Tutorial Styles */
@keyframes tutorialRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.popup {
    width: 80%;
    max-width: 800px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #007bff, #004080);
    padding: 10px 15px;
    color: #fff;
}

.tab-button {
    flex: 1;
    padding: 10px;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
    border-radius: 5px;
    margin: 0 5px;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.close-popup {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: #ffdddd;
}

.popup-content {
    padding: 25px;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
}

.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.tab-content {
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup ul {
    list-style-type: none;
    padding: 0;
}

.popup ul li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.popup ul li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #007bff;
    font-size: 1.2rem;
    transform: translateY(-2px);
}

.popup h1, .popup h2, .popup h3 {
    font-weight: bold;
    color: #004080;
    margin-bottom: 10px;
}

/* Level selector styles */
.level-selector {
    margin-top: 15px;
    border-top: 2px solid #e9ecef;
    padding-top: 15px;
}

.level-selector h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #007bff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-buttons, .table-level-buttons {
    display: flex;
    gap: 8px;
}

.level-btn, .table-level-btn {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #dee2e6;
    color: #495057;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.level-btn:hover, .table-level-btn:hover {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
    color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.level-btn.active, .table-level-btn.active {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: #ffffff;
    border-color: #1565c0;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    transform: translateY(-1px);
}

.table-level-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.table-level-selector span {
    font-weight: 600;
    color: #495057;
}

/* Turret card enhancements */
.turret-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.turret-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3, #004080);
    border-radius: 15px 15px 0 0;
}

.turret-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.turret-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.turret-card-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.turret-card-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.turret-description {
    font-size: 14px;
    color: #495057;
    margin: 0 0 15px 0;
    line-height: 1.5;
    font-style: italic;
}

.turret-ability {
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    position: relative;
}

.turret-ability::before {
    content: "⚡";
    position: absolute;
    top: -5px;
    left: -2px;
    font-size: 20px;
    background: #ffffff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ability-label {
    font-size: 12px;
    color: #1976d2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 25px;
}

.ability-text {
    font-size: 16px;
    color: #0d47a1;
    font-weight: 600;
    margin-left: 25px;
    display: block;
    margin-top: 4px;
}

.turret-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px 0;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #e99042 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.turret-stats-container {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.stats-level-indicator {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #007bff;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shots-per-second {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Grid layout for cards */
.turret-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.section-header {
    color: #2c3e50;
    font-size: 24px;
    margin: 30px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header::after {
    content: '';
    flex: 1;
    height: 3px;
    background: linear-gradient(to right, rgba(33, 150, 243, 0.8), transparent);
    border-radius: 2px;
}

/* Animation for level change */
.turret-stats-container {
    transition: all 0.3s ease;
}

.level-btn.active, .table-level-btn.active {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1) translateY(-1px); }
    50% { transform: scale(1.05) translateY(-2px); }
    100% { transform: scale(1) translateY(-1px); }
}

/* Level-specific ability display */
.level-ability-display {
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.level-ability-display::before {
    content: "🔮";
    position: absolute;
    top: -5px;
    left: -2px;
    font-size: 20px;
    background: #ffffff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.level-ability-display .ability-label {
    font-size: 12px;
    color: #e65100;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 25px;
    display: block;
}

.level-ability-display .ability-text {
    font-size: 14px;
    color: #bf360c;
    font-weight: 500;
    margin-left: 25px;
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

/* Special styling for different ability types */
.level-ability-display:has(.ability-text:contains("Freeze")) {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left-color: #2196f3;
}

.level-ability-display:has(.ability-text:contains("Freeze"))::before {
    content: "❄️";
}

.level-ability-display:has(.ability-text:contains("invisible")) {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-left-color: #9c27b0;
}

.level-ability-display:has(.ability-text:contains("invisible"))::before {
    content: "👁️";
}

.level-ability-display:has(.ability-text:contains("stun")) {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-left-color: #ffc107;
}

.level-ability-display:has(.ability-text:contains("stun"))::before {
    content: "🛡️";
}

/* Responsive Design */
@media (max-width: 768px) {
    .turret-overview-grid,
    .powerup-overview-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .turret-quick-stats,
    .powerup-stats {
        grid-template-columns: 1fr;
    }
    
    .table-level-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .usage-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .turret-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .turret-quick-stats {
        grid-template-columns: 1fr;
    }
    
    .popup {
        width: 95%;
        margin: 10px;
    }
    
    .popup-content {
        padding: 15px;
    }
}
