@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #00a87c;
    --primary-dark: #1b8a73;
    --text-main: #333333;
    --text-light: #666666;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 30px 20px;
    background: transparent;
}

.banner-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: var(--shadow);
    background-color: #1a1a1a;
    min-height: 200px;
    position: relative;
}

.banner-container img,
.banner-container #banner-fallback {
    border-radius: var(--radius);
}

.banner-container img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    min-height: 200px;
    max-height: 350px;
}

@media (min-width: 768px) {
    .banner-container {
        min-height: 250px;
    }

    .banner-container img {
        min-height: 250px;
        max-height: 350px;
    }
}

.banner-fallback {
    padding: 60px 20px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.banner-fallback h1 {
    font-size: 2.5rem;
    margin: 0;
}

.banner-fallback p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-top: 10px;
}

.banner-info-wrapper {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
}

.banner-info-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.banner-info-icon:hover {
    background: white;
    transform: scale(1.1);
}

.banner-tooltip {
    position: absolute;
    top: 45px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    padding: 20px;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    text-align: right;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.banner-info-wrapper:hover .banner-tooltip,
.banner-info-wrapper.active .banner-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.banner-tooltip h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-weight: 700;
}

.banner-tooltip p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 12px;
}

.tooltip-note {
    color: var(--primary-color) !important;
    font-weight: 500;
    font-size: 0.9rem !important;
    margin-top: 15px !important;
}

main.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 0 60px;
    flex: 1;
}

.firmware-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 700px) {
    .firmware-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .firmware-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 35px 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 220px;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 10px 0 10px;
    color: var(--text-main);
}

.version-text {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 20px;
    display: block;
}

.info-wrapper {
    position: absolute;
    top: 15px;
    right: 15px;
}

.info-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e8f5f2;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: default;
    transition: background 0.2s;
}

.info-icon:hover {
    background: #d0ebe5;
}

.tooltip {
    position: absolute;
    top: 35px;
    right: 0;
    width: 280px;
    max-width: 90vw;
    background: #333;
    color: #fff;
    font-size: 0.85rem;
    padding: 14px;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s;
    z-index: 100;
    text-align: right;
    line-height: 1.6;
    pointer-events: none;
    word-wrap: break-word;
    white-space: normal;
}

.info-wrapper:hover .tooltip,
.info-wrapper.active .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-download {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
    transition: background 0.2s, transform 0.1s;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-disabled {
    background: #e0e0e0;
    color: #999;
    pointer-events: none;
}

.loading {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin: 60px 0;
}

.error-msg {
    text-align: center;
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 12px;
    margin: 40px auto;
    max-width: 600px;
}

footer {
    text-align: center;
    padding: 25px;
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #e0e0e0;
    background: var(--card-bg);
    margin-top: auto;
}
