/* =============================================
   TOOL SECTION STYLES - REVISED WITH LUCIDE
   YouTube Thumbnail Downloader Tool UI
   ============================================= */

/* --- TOOL SECTION --- */
.tool-section {
    padding: 70px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg) 100%);
    position: relative;
}

.tool-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.tool-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    font-weight: 400;
}

/* --- TOOL CARD --- */
.tool-card {
    background: var(--card-bg);
    padding: 45px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

/* --- INPUT GROUP --- */
.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
    width: 100%;
}

.input-wrapper {
    flex: 1 1 auto;
    position: relative;
    min-width: 0;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

input[type="text"],
input[type="url"] {
    width: 100%;
    height: 56px;
    padding: 0 20px 0 50px;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
    line-height: 1.5;
}

input[type="text"]::placeholder,
input[type="url"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

input[type="text"]:focus,
input[type="url"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"].error,
input[type="url"].error {
    border-color: var(--error-color);
}

/* --- ACTION BUTTON --- */
button#action-btn {
    padding: 0 40px;
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    flex: 0 0 auto;
}

button#action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

button#action-btn i {
    width: 20px;
    height: 20px;
}

/* --- ERROR MESSAGE --- */
.error-msg {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: left;
    padding: 8px 12px;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    display: none;
}

/* --- RESULT CONTAINER --- */
.result-container {
    margin-top: 40px;
}

/* --- LOADER SECTION --- */
.loader-section {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

.loader-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- DOWNLOAD SECTION --- */
.download-section {
    display: none;
    animation: fadeInUp 0.5s ease;
    text-align: left;
}

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

.download-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-section h3 i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

/* --- PREVIEW AREA --- */
.preview-area {
    margin-bottom: 30px;
}

.preview-image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.preview-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.video-id-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.video-id-info code {
    background-color: var(--bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- ADS AREA --- */
.ads-area {
    margin-bottom: 30px;
}

.ads-placeholder {
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.ads-placeholder i {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    opacity: 0.5;
}

.ads-placeholder p {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.ads-subtext {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* --- COUNTER SECTION --- */
.counter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    display: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.counter-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.counter-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.counter-content {
    flex: 1;
}

.counter-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.counter-time {
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.counter-time span {
    font-size: 2.5rem;
}

.counter-progress {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.counter-progress-bar {
    height: 100%;
    background-color: white;
    width: 0%;
    transition: width 1s linear;
    border-radius: 10px;
}

/* --- DOWNLOAD AREA --- */
.download-area {
    margin-bottom: 30px;
    transition: opacity var(--transition-base);
}

.download-area.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.download-area.enabled-animation {
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- DOWNLOAD BUTTONS --- */
.dl-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 1rem;
}

.dl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dl-btn:not(:disabled):hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.dl-btn-zip {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-color: var(--primary-color);
    margin-bottom: 20px;
}

.dl-btn-zip:not(:disabled):hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.dl-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dl-info i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dl-info > span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.dl-title {
    font-weight: 600;
    font-size: 1rem;
}

.dl-resolution {
    font-size: 0.85rem;
    opacity: 0.8;
}

.dl-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- DIVIDER --- */
.divider-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 20px 0;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--border-color);
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

/* --- RESET SECTION --- */
.reset-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.reset-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.reset-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.reset-btn i {
    width: 20px;
    height: 20px;
}

/* --- QUICK TIPS --- */
.quick-tips {
    margin-top: 30px;
    text-align: center;
}

.quick-tips p {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tip-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.quick-tips strong {
    color: var(--primary-color);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .tool-section {
        padding: 50px 0;
    }

    .tool-title {
        font-size: 2rem;
    }

    .tool-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .tool-card {
        padding: 30px 20px;
    }

    .input-group {
        flex-direction: column;
    }

    button#action-btn {
        width: 100%;
        justify-content: center;
        padding: 16px;
    }

    .counter-time {
        font-size: 1.5rem;
    }

    .counter-time span {
        font-size: 2rem;
    }

    .dl-btn {
        padding: 14px 16px;
    }

    .dl-title {
        font-size: 0.95rem;
    }

    .dl-resolution {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 1.75rem;
    }

    .tool-card {
        padding: 25px 15px;
    }

    input[type="text"],
    input[type="url"] {
        padding: 14px 16px 14px 44px;
        font-size: 0.95rem;
    }

    .download-section h3 {
        font-size: 1.15rem;
    }
}

/* --- FORM VISIBILITY STATES --- */
.tool-card #tool-form {
    display: flex;
}

.tool-card #tool-form.hidden {
    display: none;
}

.quick-tips.hidden {
    display: none;
}