/**
 * Dashboard Page Styles - Dark Theme
 */

/* ========== Why Us Link ========== */
.why-us-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
    margin-left: auto;
    margin-right: 20px;
}

.why-us-link:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

/* ========== User Info ========== */
.user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

.logout-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ========== Credits Display ========== */
.credits-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--gradient);
    border-radius: var(--radius);
    color: white;
}

.credits-count {
    font-size: 14px;
    font-weight: 600;
}

.credits-count span {
    font-size: 18px;
}

.buy-credits-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.buy-credits-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

/* ========== Main Content ========== */
.dashboard-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ========== Usage Card ========== */
.usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.usage-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.usage-icon svg {
    width: 24px;
    height: 24px;
}

.usage-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.usage-info h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.usage-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.usage-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.usage-number,
.usage-detail {
    text-align: center;
}

.usage-remaining {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-hover);
    line-height: 1;
}

.usage-used {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.usage-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.usage-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

.usage-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gradient);
    color: white;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.usage-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-glow);
    text-decoration: none;
}

.usage-upgrade svg {
    width: 16px;
    height: 16px;
}

/* ========== Promo Card ========== */
.promo-card {
    display: flex;

    display: none;
    
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 30px;
    
    align-items: center;
    gap: 20px;
}

.promo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.promo-icon svg {
    width: 24px;
    height: 24px;
}

.promo-content {
    flex: 1;
}

.promo-content h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.promo-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gradient);
    color: white;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
    text-decoration: none;
    color: white;
}

.promo-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 600px) {
    .promo-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .promo-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Generator Card ========== */
.generator-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.generator-card .card-header {
    margin-bottom: 25px;
}

.generator-card .card-header h1 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.generator-card .card-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== Upload Section ========== */
.upload-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.upload-section h3 {
    font-size: 15px;
    margin-bottom: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-section h3 svg {
    color: var(--primary-hover);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.upload-item {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-input);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.upload-item.has-image {
    border-style: solid;
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.upload-item input {
    display: none;
}

.upload-icon {
    margin-bottom: 8px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.upload-item:hover .upload-icon {
    color: var(--primary-hover);
}

.upload-item.has-image .upload-icon {
    color: var(--success);
}

.upload-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-label .size-hint {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.upload-preview {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: none;
    transition: all 0.2s;
}

.upload-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.upload-item.has-image .upload-remove {
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

.upload-hint a {
    color: var(--primary-hover);
    text-decoration: none;
}

.upload-hint a:hover {
    text-decoration: underline;
}

/* ========== Form Sections ========== */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title svg {
    color: var(--primary-hover);
}

.optional-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Collapsible Optional Sections */
.form-section.collapsible .form-section-title {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    transition: margin-bottom 0.2s ease;
}

.form-section.collapsible.expanded .form-section-title {
    margin-bottom: 18px;
}

.form-section.collapsible .form-section-title::after {
    content: '';
    margin-left: auto;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
}

.form-section.collapsible.expanded .form-section-title::after {
    transform: rotate(180deg);
}

.form-section.collapsible .form-section-content {
    display: none;
    overflow: hidden;
}

.form-section.collapsible.expanded .form-section-content {
    display: block;
}

/* ========== Form Row Layouts ========== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ========== Form Hint Warning ========== */
.form-hint.warning {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--warning);
    margin-top: 8px;
}

.form-hint.warning svg {
    flex-shrink: 0;
}

/* ========== Color Input ========== */
.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-control-color {
    width: 50px;
    height: 42px;
    padding: 4px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-input);
}

.form-control-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-control-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-text {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
}

/* ========== Checkbox Label ========== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    line-height: 1.4;
}

/* ========== Input with Suggest Button ========== */
.input-with-suggest {
    position: relative;
}

.input-with-suggest input,
.input-with-suggest textarea {
    padding-right: 110px;
}

.suggest-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggest-btn svg {
    width: 14px;
    height: 14px;
}

.suggest-btn:hover:not(:disabled) {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 2px 12px var(--shadow-glow);
}

.suggest-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.suggest-btn.loading {
    background: var(--bg-hover);
}

/* ========== Form Actions ========== */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.generate-btn {
    flex: 1;
    padding: 16px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn svg {
    width: 20px;
    height: 20px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-glow);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.clear-btn {
    padding: 16px 24px;
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ========== Model Info ========== */
.model-info {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.model-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-badge.pro {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.model-badge.free {
    background: var(--gradient);
    color: white;
}

/* ========== Loading Time ========== */
.loading-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ========== Result Section ========== */
.result {
    display: none;
    margin-top: 25px;
    padding: 25px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.result-header svg {
    color: var(--success);
    width: 24px;
    height: 24px;
}

.result h3 {
    color: var(--success);
    font-size: 18px;
    margin: 0;
}

.result p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Row 1: Preview, Edit & Publish, Download ZIP */
.result-buttons .preview-btn,
.result-buttons .edit-btn,
.result-buttons .download-btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 140px;
}

.download-btn,
.preview-btn,
.edit-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-btn svg,
.preview-btn svg,
.edit-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn {
    background: var(--success);
    color: white;
    border: none;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.preview-btn {
    background: transparent;
    color: var(--primary-hover);
    border: 2px solid var(--primary);
}

.preview-btn:hover {
    background: var(--primary);
    color: white;
}

.edit-btn {
    background: var(--gradient);
    color: white;
    border: none;
}

.edit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

/* ========== Admin Section ========== */
.admin-only {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 20px;
}

.admin-only .form-section-title {
    color: var(--danger);
}

.admin-only .form-section-title svg {
    color: var(--danger);
}

/* ========== History Card ========== */
.history-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.history-list {
    list-style: none;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: none;
}

.history-info h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.history-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-btn {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.history-download {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.history-download:hover {
    background: rgba(16, 185, 129, 0.25);
}

.history-preview {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-hover);
}

.history-preview:hover {
    background: rgba(99, 102, 241, 0.25);
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .why-us-link {
        margin-left: 0;
        margin-right: 0;
        text-align: center;
    }

    .user-info {
        gap: 12px;
    }

    .credits-display {
        padding: 6px 12px;
        gap: 8px;
    }

    .credits-count {
        font-size: 12px;
    }

    .credits-count span {
        font-size: 14px;
    }

    .buy-credits-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .logout-btn span {
        display: none;
    }
}

@media (max-width: 600px) {
    .dashboard-main {
        padding: 20px 15px;
    }

    .usage-card {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .usage-icon {
        display: none;
    }

    .usage-content {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }

    .usage-info {
        text-align: center;
    }

    .usage-info h2 {
        font-size: 14px;
    }

    .usage-subtitle {
        font-size: 12px;
    }

    .usage-stats {
        justify-content: center;
        gap: 24px;
    }

    .usage-remaining {
        font-size: 24px;
    }

    .usage-upgrade {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .generator-card {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .clear-btn {
        order: 1;
    }

    .result-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .result-buttons .preview-btn,
    .result-buttons .edit-btn,
    .result-buttons .download-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }

    .suggest-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .input-with-suggest input,
    .input-with-suggest textarea {
        padding-right: 95px;
    }

    .upload-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== Download Modal ========== */
#downloadModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    max-width: none;
    box-shadow: none;
}

#downloadModal .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 0;
}

#downloadModal .modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin: auto;
    z-index: 1;
}

#downloadModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

#downloadModal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

#downloadModal .modal-header h3 svg {
    color: var(--primary);
}

#downloadModal .modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

#downloadModal .modal-close:hover {
    color: var(--danger);
}

#downloadModal .modal-body {
    padding: 24px;
}

#downloadModal .modal-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 16px 0 0 0;
    line-height: 1.6;
}

#downloadModal .alert-info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-hover);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#downloadModal .alert-info svg {
    flex-shrink: 0;
    margin-top: 2px;
}

#downloadModal .alert-info strong {
    color: var(--primary-hover);
}

#downloadModal .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header svg {
    color: var(--text-secondary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-description code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary-hover);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

/* ========== Modal Responsive Styles ========== */
@media (max-width: 768px) {
    /* Download Modal */
    #downloadModal .modal-content {
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    #downloadModal .modal-header {
        padding: 14px 16px;
    }

    #downloadModal .modal-header h3 {
        font-size: 15px;
        gap: 8px;
    }

    #downloadModal .modal-header h3 svg {
        width: 20px;
        height: 20px;
    }

    #downloadModal .modal-body {
        padding: 16px;
    }

    #downloadModal .alert-info {
        font-size: 12px;
        padding: 10px 12px;
    }

    #downloadModal .modal-description {
        font-size: 13px;
    }

    #downloadModal .modal-footer {
        padding: 12px 16px;
        gap: 8px;
    }

    #downloadModal .modal-footer .btn-primary,
    #downloadModal .modal-footer .btn-secondary {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ========== Pricing Tiers Input ========== */
#pricingTiersContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pricing-tier-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
}

.pricing-tier-card:hover {
    border-color: var(--primary);
}

.pricing-tier-card.highlighted {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.pricing-tier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.pricing-tier-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-tier-number .tier-badge {
    background: var(--gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.remove-tier-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-tier-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.remove-tier-btn svg {
    width: 18px;
    height: 18px;
}

.pricing-tier-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.highlight-toggle input {
    display: none;
}

.highlight-toggle .highlight-icon {
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.highlight-toggle:hover .highlight-icon {
    color: var(--warning);
}

.highlight-toggle input:checked + .highlight-icon {
    color: var(--warning);
}

.highlight-badge-field {
    background: rgba(245, 158, 11, 0.1);
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.highlight-badge-field label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.highlight-badge-field input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
}

.highlight-badge-field input:focus {
    border-color: var(--warning);
    outline: none;
}

.pricing-tier-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pricing-tier-fields .form-group {
    margin-bottom: 0;
}

.pricing-tier-fields .form-group.full-width {
    grid-column: 1 / -1;
}

.pricing-tier-fields label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.pricing-tier-fields input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.2s;
}

.pricing-tier-fields input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.pricing-tier-fields input::placeholder {
    color: var(--text-muted);
}

.add-tier-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.add-tier-btn:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    background: rgba(99, 102, 241, 0.05);
}

.add-tier-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-tier-btn:disabled:hover {
    border-color: var(--border);
    color: var(--text-secondary);
    background: transparent;
}

.add-tier-btn svg {
    width: 18px;
    height: 18px;
}

.pricing-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

/* Pricing Tiers Responsive */
@media (max-width: 600px) {
    .pricing-tier-fields {
        grid-template-columns: 1fr;
    }

    .pricing-tier-card {
        padding: 14px;
    }

    .pricing-tier-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .pricing-tier-number {
        font-size: 13px;
    }

    .pricing-tier-fields input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .add-tier-btn {
        padding: 12px;
        font-size: 13px;
    }
}
