/**
 * Content Submission Form Styles
 * Modern, responsive design for the GitHub-integrated content form
 */

.content-submission-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

/* Form Header */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.form-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-form-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.close-form-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Authentication Section */
.auth-section {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.auth-status {
    margin-bottom: 15px;
}

.auth-loading {
    color: #6b7280;
    font-style: italic;
}

.auth-success {
    color: #059669;
    font-weight: 600;
}

.auth-error {
    color: #dc2626;
    font-weight: 600;
}

.login-section h3 {
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.login-section p {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

.github-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1f2937;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.github-login-btn:hover {
    background: #374151;
    transform: translateY(-1px);
}

.github-login-btn svg {
    width: 20px;
    height: 20px;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
}

.user-login {
    color: #6b7280;
    font-size: 0.875rem;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Form Section */
.form-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.content-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-help {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Field Validation States */
.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: 500;
}

.field-success {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: 500;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Content Type Specific Fields */
.github-content-fields,
.local-content-fields {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.github-content-fields h4,
.local-content-fields h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

.preview-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: #4b5563;
}

.submit-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: #059669;
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

/* Preview Section */
.preview-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.preview-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.preview-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.preview-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
}

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

.preview-item h4 {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-item p {
    color: #1f2937;
    margin: 0;
}

.content-preview {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    max-height: 200px;
    overflow-y: auto;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.back-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #4b5563;
}

.confirm-submit-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-submit-btn:hover:not(:disabled) {
    background: #059669;
}

.confirm-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Submission Result */
.submission-result {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.result-success {
    text-align: center;
}

.result-success h3 {
    color: #059669;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.result-success p {
    color: #374151;
    margin-bottom: 15px;
}

.pr-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e5e7eb;
}

.pr-info p {
    margin: 5px 0;
}

.pr-info a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.pr-info a:hover {
    text-decoration: underline;
}

.new-submission-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-submission-btn:hover {
    background: #4f46e5;
}

.result-error {
    text-align: center;
}

.result-error h3 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.result-error p {
    color: #374151;
    margin-bottom: 10px;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-family: monospace;
    font-size: 0.875rem;
}

.retry-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-submission-panel {
        padding: 20px;
        margin: 10px 0;
    }

    .user-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions,
    .preview-actions {
        flex-direction: column;
    }

    .form-actions button,
    .preview-actions button {
        width: 100%;
    }

    .content-preview {
        max-height: 150px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    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 #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form Validation States */
.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: #ef4444;
}

.form-group input:valid,
.form-group select:valid,
.form-group textarea:valid {
    border-color: #10b981;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}
