/* =============================================
   YouTube SEO Analyzer - Main Stylesheet
   Version: 3.0.0
   Author: Lt Ashik ali
   ============================================= */

/* ---------- General Styles ---------- */
.ytseo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1F2937;
}

.ytseo-step {
    margin-bottom: 40px;
}

.ytseo-step h2 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #1E3A8A 0%, #6D28D9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
}

.ytseo-step h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.ytseo-step h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: #F97316;
    border-radius: 2px;
}

/* ---------- Search Box ---------- */
.ytseo-search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#ytseo-topic {
    flex: 1;
    min-width: 250px;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #E5E7EB;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.3s;
}

#ytseo-topic:focus {
    border-color: #1E3A8A;
}

.ytseo-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.ytseo-btn-primary {
    background-color: #1E3A8A;
    color: white;
}

.ytseo-btn-primary:hover {
    background-color: #2563EB;
}

.ytseo-btn-secondary {
    background-color: #F97316;
    color: white;
}

.ytseo-btn-secondary:hover {
    background-color: #FB923C;
}

.ytseo-btn:active {
    transform: scale(0.98);
}

/* ---------- Loader (Improved) ---------- */
.ytseo-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.ytseo-loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top-color: #1E3A8A;
    border-radius: 50%;
    animation: ytseo-spin 1s linear infinite;
}

@keyframes ytseo-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Title Grid (Improved) ---------- */
.ytseo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.ytseo-title-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ytseo-title-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.ytseo-title-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1F2937;
    line-height: 1.5;
    flex-grow: 1;
}

.ytseo-title-card .badge {
    display: inline-block;
    background: #FEF3C7;
    color: #92400E;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 15px;
    align-self: flex-start;
}

.ytseo-title-card .best-badge {
    background: #F97316;
    color: white;
}

.ytseo-title-card p {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ytseo-title-card button.select-title {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background-color: #1E3A8A;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ytseo-title-card button.select-title:hover {
    background-color: #2563EB;
}

/* ---------- Feedback Form ---------- */
.ytseo-feedback {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #E5E7EB;
}

.ytseo-feedback-question {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 8px;
}

.ytseo-feedback-buttons {
    display: flex;
    gap: 10px;
}

.ytseo-feedback-buttons button {
    flex: 1;
    padding: 6px;
    border: 1px solid #E5E7EB;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.ytseo-feedback-yes:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.ytseo-feedback-no:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

.ytseo-feedback-comment {
    margin-top: 10px;
}

.ytseo-feedback-comment textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

.ytseo-submit-feedback {
    background: #3B82F6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}

/* ---------- User Section ---------- */
.ytseo-user-section {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ytseo-not-logged-in {
    background: #FEF3C7;
    padding: 10px;
    border-radius: 8px;
    margin: 20px 0;
    color: #92400E;
}

/* ---------- History Modal ---------- */
#ytseo-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ytseo-modal-content {
    background: white;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
}

.ytseo-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9CA3AF;
}

.ytseo-close-modal:hover {
    color: #EF4444;
}

.ytseo-history-item {
    background: #f9fafb;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.ytseo-history-item h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.ytseo-history-date {
    color: #6B7280;
    font-size: 12px;
}

/* ---------- Channel Analytics ---------- */
.ytseo-channel-input {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

#ytseo-channel-id {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

#ytseo-channel-stats, #ytseo-personalized-tips {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

/* ---------- AI Titles, Tags, Competitor ---------- */
#ytseo-ai-titles-list, #ytseo-tag-suggestions, #competitor-results {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

/* ---------- Description Area ---------- */
.ytseo-textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.ytseo-button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* ---------- Thumbnail Guide ---------- */
.ytseo-thumbnail-guide {
    background: #F9FAFB;
    border-left: 4px solid #F97316;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.ytseo-thumbnail-guide h4 {
    color: #1E3A8A;
    margin-bottom: 15px;
}

.ytseo-thumbnail-guide p {
    margin-bottom: 10px;
}

.ytseo-examples {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

/* ---------- Thumbnail Preview ---------- */
.ytseo-thumbnail-preview-container {
    margin: 20px 0;
    text-align: center;
}

.ytseo-thumbnail-preview {
    width: 100%;
    max-width: 400px;
    height: 225px; /* 16:9 aspect ratio */
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

.ytseo-thumbnail-text {
    font-size: 32px;
    font-weight: 900;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    padding: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.ytseo-thumbnail-emoji {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 40px;
}

.ytseo-download-thumbnail {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #10B981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.ytseo-download-thumbnail:hover {
    background-color: #059669;
}

/* ---------- Donation Button ---------- */
.ytseo-donation-section {
    text-align: center;
    margin: 30px 0 20px;
    padding: 15px;
    border-top: 1px solid #E5E7EB;
}

.ytseo-donation-btn {
    display: inline-block;
    background: #FFDD00;
    color: #000000;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ytseo-donation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    background: #FFE55C;
}

/* ---------- Language Switcher ---------- */
.ytseo-language-switcher {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.ytseo-language-switcher select {
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
    background: white;
    cursor: pointer;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
    .ytseo-grid {
        grid-template-columns: 1fr;
    }
    
    .ytseo-search-box {
        flex-direction: column;
    }
    
    #ytseo-topic {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .ytseo-btn {
        width: 100%;
    }
    
    .ytseo-title-card h4 {
        font-size: 16px;
    }
    
    .ytseo-thumbnail-preview {
        max-width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .ytseo-language-switcher {
        position: static;
        text-align: right;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .ytseo-step h2 {
        font-size: 24px;
    }
    
    .ytseo-step h3 {
        font-size: 20px;
    }
    
    .ytseo-donation-btn {
        font-size: 16px;
        padding: 10px 20px;
    }
}