/* YT Downloader WordPress Plugin Styles */

/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.yt-downloader-container {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.yt-downloader-container * {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Ensure all text elements use Poppins */
.yt-downloader-container h1,
.yt-downloader-container h2,
.yt-downloader-container h3,
.yt-downloader-container h4,
.yt-downloader-container h5,
.yt-downloader-container h6,
.yt-downloader-container p,
.yt-downloader-container span,
.yt-downloader-container div,
.yt-downloader-container label,
.yt-downloader-container button,
.yt-downloader-container input,
.yt-downloader-container select,
.yt-downloader-container textarea {
    font-family: "Poppins", sans-serif !important;
}

.yt-downloader-container[data-theme="dark"] {
    --yt-background: #121212;
    --yt-text: rgb(229, 229, 229);
    --yt-box-main: #1d1d1d;
    --yt-box-toggle: #191919;
    --yt-box-separation: #2e2e2e;
    --yt-box-toggleOn: #2e2e2e;
    --yt-item-bg: #2c2e31;
    --yt-select: #6366f1;
    --yt-greenBtn: #6366f1;
    --yt-greenBtn-top: #6366f1;
    --yt-greenBtn-bottom: #4f46e5;
    --yt-redBtn: #c82b2d;
    --yt-blueBtn: rgb(80, 128, 230);
    --yt-blueBtn-bottom: rgb(44, 78, 180);
}

.yt-downloader-container[data-theme="light"] {
    --yt-background: #fff;
    --yt-text: rgb(45, 45, 45);
    --yt-box-main: #f5f5f5;
    --yt-box-toggle: #e5e7eb;
    --yt-box-separation: #e5e7eb;
    --yt-box-toggleOn: #d1d5db;
    --yt-item-bg: #f9fafb;
    --yt-select: #6366f1;
    --yt-greenBtn: #6366f1;
    --yt-greenBtn-top: #6366f1;
    --yt-greenBtn-bottom: #4f46e5;
    --yt-redBtn: #d64d4f;
    --yt-blueBtn: rgb(80, 128, 230);
    --yt-blueBtn-bottom: rgb(44, 78, 180);
}

.yt-downloader-wrapper {
    background-color: var(--yt-box-main);
    border-radius: 20px;
    padding: 30px;
    color: var(--yt-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.yt-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
}

.yt-url-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--yt-box-separation);
    border-radius: 12px;
    font-size: 16px;
    font-family: "Poppins", sans-serif !important;
    background-color: var(--yt-background);
    color: var(--yt-text);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.yt-url-input::placeholder {
    color: var(--yt-text);
    opacity: 0.5;
}

.yt-url-input:focus {
    outline: none;
    border-color: var(--yt-greenBtn);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Unified Button Style - Applied to all action buttons */
.yt-submit-btn,
#yt-video-download,
#yt-audio-download,
#yt-extract-btn {
    padding: 12px 30px;
    background-color: var(--yt-greenBtn) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: "Poppins", sans-serif !important;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.yt-submit-btn:hover,
#yt-video-download:hover,
#yt-audio-download:hover,
#yt-extract-btn:hover {
    background-color: var(--yt-greenBtn-bottom) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.yt-submit-btn:active,
#yt-video-download:active,
#yt-audio-download:active,
#yt-extract-btn:active {
    background-color: var(--yt-greenBtn-bottom) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

.yt-submit-btn:disabled,
#yt-video-download:disabled,
#yt-audio-download:disabled,
#yt-extract-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Ensure all buttons have consistent styling */
#yt-submit-url,
#yt-video-download,
#yt-audio-download,
#yt-extract-btn {
    background-color: var(--yt-greenBtn) !important;
    color: white !important;
    font-family: "Poppins", sans-serif !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.yt-loading-wrapper {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.yt-error-msg {
    font-family: "Poppins", sans-serif !important;
    color: var(--yt-redBtn);
    background-color: rgba(200, 43, 45, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid var(--yt-redBtn);
    font-size: 14px;
    font-weight: 500;
}

.yt-feedback {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
}

.yt-status {
    background-color: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--yt-select);
    color: var(--yt-text);
}

.yt-profile-header h2 {
    font-weight: 600;
    color: var(--yt-text);
}

.yt-hidden-panel {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--yt-box-main);
    border-radius: 10px;
    position: relative;
}

.yt-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-family: "Poppins", sans-serif !important;
    cursor: pointer;
    color: var(--yt-text);
    padding: 5px 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.yt-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.yt-toggle-btn {
    padding: 10px 20px;
    background-color: var(--yt-box-toggle);
    border: none;
    border-radius: 8px;
    color: var(--yt-text);
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.yt-toggle-btn:hover {
    background-color: var(--yt-box-separation);
}

.yt-toggle-btn.yt-active {
    background-color: var(--yt-box-toggleOn);
    font-weight: 600;
}

.yt-select {
    width: 100% !important;
    padding: 10px 15px !important;
    border: 2px solid var(--yt-box-separation) !important;
    border-radius: 8px !important;
    background-color: var(--yt-background) !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 20px !important;
    color: var(--yt-text) !important;
    font-size: 14px !important;
    font-family: "Poppins", sans-serif !important;
    font-weight: 400 !important;
    margin-top: 10px !important;
    text-align: left !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.yt-select:focus {
    outline: none !important;
    border-color: var(--yt-select) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.yt-select option {
    color: var(--yt-text) !important;
    background-color: var(--yt-box-main) !important;
    padding: 10px 15px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.yt-select option:checked,
.yt-select option:focus {
    background-color: var(--yt-select) !important;
    color: white !important;
}

.yt-select option:hover {
    background-color: rgba(99, 102, 241, 0.2) !important;
}

/* Hide format selects when using cards */
#yt-video-format-select,
#yt-audio-format-select {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Keep other selects visible */
#yt-audio-for-video-format-select,
#yt-extract-selection,
#yt-extract-quality-select {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    pointer-events: auto !important;
    z-index: 10 !important;
    position: relative !important;
}

.yt-blue-btn {
    padding: 10px 20px;
    background-color: var(--yt-blueBtn);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.yt-blue-btn:hover {
    background-color: var(--yt-blueBtn-bottom);
}

.yt-advanced-toggle {
    background: none;
    border: none;
    color: var(--yt-blueBtn);
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.yt-advanced-toggle:hover {
    color: var(--yt-blueBtn-bottom);
    background: rgba(80, 128, 230, 0.1);
    text-decoration: none;
}

.yt-download-item {
    background-color: var(--yt-item-bg);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yt-item-title {
    font-family: "Poppins", sans-serif !important;
    font-weight: 600;
    margin-bottom: 5px;
}

.yt-item-meta {
    font-family: "Poppins", sans-serif !important;
    font-size: 12px;
    color: var(--yt-text);
    opacity: 0.8;
}

.yt-download-link {
    color: var(--yt-greenBtn);
    text-decoration: none;
    margin-right: 10px;
    font-family: "Poppins", sans-serif !important;
}

.yt-download-link:hover {
    text-decoration: underline;
}

.yt-item-size {
    margin: 0 10px;
}

.yt-item-type {
    padding: 2px 8px;
    background-color: var(--yt-box-toggle);
    border-radius: 3px;
    font-size: 11px;
}

.yt-separation-box {
    margin: 20px 0;
    padding: 15px;
    background-color: transparent;
    border-radius: 8px;
}

.yt-separation-box h2,
#yt-audio-present h2 {
    font-family: "Poppins", sans-serif !important;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 10px;
    margin-top: 0;
    line-height: 1.4;
}

.yt-format-select {
    display: block;
    margin-top: 10px;
    font-family: "Poppins", sans-serif !important;
    font-weight: 600;
    font-size: 14px;
}

.yt-hidden-panel p,
.yt-hidden-panel #yt-title {
    font-family: "Poppins", sans-serif !important;
    font-weight: 500;
    font-size: 16px;
}

.yt-downloader-container p {
    font-family: "Poppins", sans-serif !important;
}

.yt-advanced-item {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--yt-item-bg);
    border-radius: 8px;
}

.yt-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.yt-time-display {
    width: 80px;
    padding: 5px;
    border: 1px solid var(--yt-box-separation);
    border-radius: 4px;
    text-align: center;
    background-color: var(--yt-background);
    color: var(--yt-text);
}

.yt-slider-container {
    flex: 1;
    position: relative;
    height: 30px;
}

.yt-track-background {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--yt-box-separation);
    transform: translateY(-50%);
}

#yt-range-highlight {
    position: absolute;
    top: 50%;
    height: 4px;
    background-color: var(--yt-greenBtn);
    transform: translateY(-50%);
}

.yt-slider-container input[type="range"] {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.yt-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: var(--yt-greenBtn);
    border-radius: 50%;
    cursor: pointer;
}

.yt-slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background-color: var(--yt-greenBtn);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.yt-cb {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#yt-list {
    margin-top: 20px;
}

/* Format Cards (like aiodown.com) */
.yt-format-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    justify-items: center;
    justify-content: center;
}

/* Single card - centered */
.yt-format-cards.single-card {
    display: flex;
    justify-content: center;
}

/* Two cards - centered side-by-side */
.yt-format-cards.two-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Three or more cards - grid of 3 per line */
.yt-format-cards.multiple-cards {
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    max-width: 100%;
}

@media (max-width: 768px) {
    .yt-format-cards.multiple-cards {
        grid-template-columns: 1fr;
    }
    
    .yt-format-cards.two-cards {
        flex-direction: column;
        align-items: center;
    }
}

.yt-format-card {
    background-color: transparent;
    border: 2px solid var(--yt-box-separation);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    cursor: pointer;
}

.yt-format-card:hover {
    border-color: var(--yt-greenBtn);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.yt-format-card-content {
    flex: 1;
}

.yt-format-card-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.yt-format-resolution,
.yt-format-quality {
    font-size: 20px;
    font-weight: 700;
    color: var(--yt-text);
    font-family: "Poppins", sans-serif !important;
}

.yt-format-ext {
    font-size: 14px;
    font-weight: 500;
    color: var(--yt-text);
    opacity: 0.8;
    font-family: "Poppins", sans-serif !important;
}

.yt-format-audio-icon {
    font-size: 18px;
    margin-left: 5px;
}

.yt-format-no-audio {
    font-size: 11px;
    color: var(--yt-redBtn);
    font-weight: 500;
    font-family: "Poppins", sans-serif !important;
}

.yt-format-audio-auto {
    font-size: 12px;
    color: var(--yt-greenBtn);
    font-weight: 600;
    font-family: "Poppins", sans-serif !important;
    margin-left: 5px;
}

.yt-format-card-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.yt-format-size,
.yt-format-fps {
    font-size: 12px;
    color: var(--yt-text);
    opacity: 0.7;
    font-family: "Poppins", sans-serif !important;
}

.yt-format-download-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--yt-greenBtn) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Poppins", sans-serif !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.yt-format-download-btn:hover {
    background-color: var(--yt-greenBtn-bottom) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.yt-format-download-btn:active {
    transform: translateY(0);
}

.yt-format-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.yt-btn-loading {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .yt-downloader-container {
        padding: 10px;
    }
    
    .yt-url-input {
        font-size: 14px;
    }
    
    .yt-submit-btn,
    #yt-video-download,
    #yt-audio-download,
    #yt-extract-btn {
        padding: 10px 20px;
        font-size: 14px;
        white-space: normal;
        width: 100%;
        margin-top: 10px;
    }

    .yt-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .yt-input-row .yt-submit-btn {
        width: 100%;
        margin: 0;
    }

    .yt-input-row .yt-url-input {
        width: 100%;
    }
    
    .yt-download-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .yt-format-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .yt-format-card {
        min-height: 100px;
    }
}

