/*
 * Plugin Name: Auto Download Buttons
 * Author: Tech-Turf
 * Version: 1.0.1
 */

.adb-container { 
    /* Main container for spacing: 50px top, 10px sides, 50px bottom */
    margin: 20px 20px 20px 20px; 
}

/* --- WRAPPER: Defines size and relative context --- */
.file-flashcard-wrapper {
    position: relative; 
    display: block;
    width: 200px; /* Standard width for button and flashcard */
    margin: 0 auto; /* Center the button */
    z-index: 10;
}

/* --- BUTTON STYLING --- */
.delayed-autodownload-btn {
    background-color: var(--adb-btn-color); 
    color: var(--adb-btn-text-color); 
    padding: 10px 20px;
    border: none;
    border-radius: var(--adb-btn-radius); 
    cursor: pointer;
    font-size: var(--adb-btn-font-size); 
    font-weight: bold;
    display: block;
    width: 100%; 
    min-height: 50px; 
    height: auto; 
    margin: 0; 
    transition: background-color 0.3s, font-size 0.3s;
    position: relative; 
    z-index: 10; 
    text-align: center;
    box-shadow: var(--adb-btn-shadow); 
}

/* Ready State Hover Effect */
.delayed-autodownload-btn:not(.waiting):hover {
    background-color: var(--adb-btn-hover-color); 
}

/* Countdown state styles */
.delayed-autodownload-btn.waiting {
    background-color: var(--adb-wait-color); 
    color: var(--adb-btn-text-color); 
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

/* --- FLASHCARD STYLING: VISIBLE BY DEFAULT, HIDES ON HOVER/COUNTDOWN --- */
.file-info-flashcard {
    position: absolute;
    bottom: 80%; 
    margin-bottom: 5px; 
    width: 75%; 
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 8px 10px;
    background: var(--adb-card-bg); 
    color: var(--adb-card-color); 
    border-radius: var(--adb-card-radius); 
    display: flex;
    justify-content: center; 
    align-items: center; 
    z-index: 9; 
    pointer-events: none; 
    font-size: var(--adb-card-font-size); 
    
    /* 1. DEFAULT STATE: VISIBLE */
    opacity: 1; 
    visibility: visible; 
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

/* 2. HOVER STATE: DISAPPEAR */
/* HIDE the flashcard when the mouse IS over the wrapper (when button is ready) */
.file-flashcard-wrapper:hover .file-info-flashcard {
    opacity: 0;
    visibility: hidden; 
    transform: translateX(-50%) translateY(20px); 
}

/* 3. COUNTDOWN STATE: MUST BE HIDDEN */
/* HIDE the flashcard when the button is in waiting state (after click) */
.file-flashcard-wrapper:has(.delayed-autodownload-btn.waiting) .file-info-flashcard {
    opacity: 0 !important;
    visibility: hidden !important; 
    transform: translateX(-50%) translateY(20px) !important;
}

/* Styling for content inside the flashcard */
.file-icon {
    font-size: 0.9em;
    margin-right: 8px;
}
.file-extension {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}