/* Submission Form Styles */
.submit-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.submit-header {
    text-align: center;
    margin-bottom: 3rem;
}

.submit-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.submit-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Instructions Box */
.instructions-box {
    background: #f8f9fa;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.instructions-box h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.instructions-box ol {
    margin: 0;
    padding-left: 1.5rem;
    color: #34495e;
}

.instructions-box ol li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.instructions-box ol li:last-child {
    margin-bottom: 0;
}

.instructions-box a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.instructions-box a:hover {
    text-decoration: underline;
    color: #2980b9;
}

.submission-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #bdc3c7;
    background: #f8f9fa;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.help-text {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.char-counter, .word-counter {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 0.3rem;
    text-align: right;
    font-weight: 500;
}

.char-counter.warning, .word-counter.warning {
    color: #f39c12;
}

.char-counter.error, .word-counter.error {
    color: #e74c3c;
    font-weight: 600;
}

.help-text a {
    color: #3498db;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

.modal h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

/* Preview Content */
#preview-content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.preview-item {
    margin-bottom: 1rem;
}

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

.preview-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.preview-value {
    color: #34495e;
    line-height: 1.5;
}

.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success States */
.success {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .submit-container {
        padding: 1rem;
    }
    
    .submit-header h1 {
        font-size: 2rem;
    }
    
    .instructions-box {
        padding: 1rem 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .instructions-box h3 {
        font-size: 1.1rem;
    }
    
    .instructions-box ol li {
        font-size: 0.9rem;
    }
    
    .submission-form {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }
}

/* Autocomplete Dropdown Styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

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

.autocomplete-item.selected {
    background-color: #e8f4f8;
}

.autocomplete-item-name {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.autocomplete-item-details {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.autocomplete-loading {
    padding: 12px 16px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.autocomplete-no-results {
    padding: 12px 16px;
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
}

/* Visual indicator that field has autocomplete */
.autocomplete-container input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* Checkbox Group Styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling for checkbox group */
.checkbox-group::-webkit-scrollbar {
    width: 8px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.checkbox-group::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.checkbox-group label,
.checkbox-group .topic-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
}

.checkbox-group label:hover,
.checkbox-group .topic-checkbox-label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0 10px 0 0;
    cursor: pointer;
    accent-color: #3498db;
    flex-shrink: 0;
}

.checkbox-group span {
    line-height: 1.4;
    flex: 1;
}

.checkbox-group input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #2c3e50;
}

.checkbox-group label:has(input:checked),
.checkbox-group .topic-checkbox-label:has(input:checked) {
    border-color: #3498db;
    background: #e3f2fd;
}
