/* Upload Form Styles */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e74c3c;
}

.upload-header h1 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.upload-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

.form-section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2::before {
    content: "";
    font-size: 1.2rem;
}

.form-section.taxonomy h2::before {
    content: "🏷️";
}

.form-section.files h2::before {
    content: "📁";
}

.form-section.pricing h2::before {
    content: "💰";
}

/* Pricing Section Styles */
.pricing-section {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.pricing-note {
    background: #e7f3ff;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: #0c5460;
    font-size: 0.9rem;
}

.pricing-guarantee {
    background: #f8f9fa;
    border: 1px solid #28a745;
    color: #155724;
}

.promo-tier-header {
    margin-bottom: 1rem;
}

.promo-tier-header h4 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.promo-tier-header p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Current Pricing Display */
.current-pricing-display {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px solid #28a745;
}

.current-pricing-display h4 {
    color: #28a745;
    margin-bottom: 1rem;
}

.price-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #ddd;
}

.price-tier.free-tier {
    border-left-color: #28a745;
    background: #f8fff9;
}

.price-tier.promo-tier {
    border-left-color: #ffc107;
    background: #fffdf0;
}

.price-tier.regular-tier {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.tier-label {
    font-weight: 500;
    color: #333;
}

.tier-price {
    font-weight: 600;
    color: #e74c3c;
    font-size: 1.1rem;
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #e74c3c;
    background: #e74c3c;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-option input[type="radio"]:checked ~ span {
    color: #e74c3c;
    font-weight: 500;
}

/* Disabled input styling */
input:disabled {
    background-color: #f5f5f5 !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Editable Dropdown Styles */
.editable-dropdown {
    position: relative;
}

.editable-dropdown input {
    padding-right: 2.5rem;
}

.dropdown-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
}

.dropdown-toggle:hover {
    color: #e74c3c;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown-list.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.highlight {
    background-color: #e74c3c;
    color: white;
}

/* YouTube Links Section */
.youtube-link-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.youtube-link-item:last-child {
    margin-bottom: 0;
}

.btn-remove-youtube {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-youtube:hover {
    background: #c82333 !important;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.file-upload-area.dragover {
    border-color: #e74c3c;
    background-color: #fff5f5;
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.file-upload-text {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    color: #999;
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

/* Different styles for different upload areas */
#main-image-upload {
    border-color: #28a745;
}

#main-image-upload:hover {
    border-color: #28a745;
    background-color: #f0fff4;
}

#secondary-images-upload {
    border-color: #17a2b8;
}

#secondary-images-upload:hover {
    border-color: #17a2b8;
    background-color: #f0f9ff;
}

/* File Preview */
.file-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f0f0;
    border-radius: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-icon {
    font-size: 1.2rem;
}

.file-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.file-remove:hover {
    background: #c82333;
}

/* Form Row for side-by-side inputs */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row.youtube-row {
    grid-template-columns: 1fr 1fr auto;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row.youtube-row {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

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

/* Loading and Success States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Image Library Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* Could be more or less, depending on screen size */
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 85vh; /* Limit height to enable scrolling */
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-content .close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-content .close-button:hover,
.modal-content .close-button:focus {
    color: #333;
    text-decoration: none;
}

.image-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    overflow-y: auto; /* Make image grid scrollable */
    flex-grow: 1; /* Allow grid to take up available space */
    padding-right: 10px; /* Space for scrollbar */
}

.image-library-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px; /* Fixed height for consistent grid */
}

.image-library-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Maintain aspect ratio without cropping */
    display: block;
}

.image-library-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

.image-library-item:hover {
    border-color: #007bff;
    transform: scale(1.02);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}