/* Main stylesheet - to be populated from extracted Drupal CSS */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.usda-header {
    background-color: #2c5f2d;
    color: white;
    padding: 1rem;
}

.usda-footer {
    background-color: #243413;
    color: white;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #1a2a0e;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem; /* Match .project-listings-section padding */
    box-sizing: border-box;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness - Base Styles */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 0 1rem;
    }

    .footer-content p {
        margin-bottom: 0;
    }

    .footer-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px 20px; /* row gap, column gap */
    }

    .header-content {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .nav-bar {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    /* Ensure touch targets are at least 44x44px */
    .btn-primary,
    a.btn-primary,
    .btn-secondary,
    .btn-link {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 24px;
    }
}

/* Small mobile footer adjustments */
@media (max-width: 480px) {
    .footer-content {
        padding: 0 0.75rem;
        gap: 10px;
    }

    .footer-content p {
        font-size: 12px;
        line-height: 1.4;
    }

    .footer-nav ul {
        gap: 8px 16px;
    }

    .footer-nav a {
        font-size: 12px;
    }
}

#main-content {
    min-height: calc(100vh - 200px);
    padding: 0;
}

.main-content {
    padding: 0;
    width: 100%;
}

.content-wrapper {
    max-width: 1400px; /* Increased from 1000px to match Figma */
    margin: 0 auto;
    padding: 2rem;
}

/* Error messages */
.error-message {
    background-color: #fee;
    border: 2px solid #fcc;
    border-left: 4px solid #c00;
    color: #c00;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-message strong {
    display: block;
    margin-bottom: 5px;
}

/* Form improvements */
.required {
    color: #c00;
    font-weight: bold;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Ensure form inputs are at least 16px to prevent iOS auto-zoom */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
        min-height: 44px;
    }
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

legend {
    font-weight: bold;
    padding: 0 10px;
    color: #2e5a3e;
}

small {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Submit button states */
#submit-status {
    display: inline-block;
    margin-left: 15px;
    color: #666;
    font-style: italic;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top-color: #2e5a3e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-actions {
    display: flex;
    align-items: center;
    margin-top: 30px;
}

.btn-primary,
a.btn-primary {
    background-color: #2e5a3e;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.btn-primary:hover:not(:disabled),
a.btn-primary:hover {
    background-color: #1e4a2e;
    color: white;
    text-decoration: none;
}

/* reCAPTCHA notice */
.recaptcha-notice {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 20px;
}

.recaptcha-notice a {
    color: #2e5a3e;
    text-decoration: none;
}

.recaptcha-notice a:hover {
    text-decoration: underline;
}

/* Header Styles - Matching Figma Design */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 100%;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: block;
    text-decoration: none;
}

.nexus-header-logo {
    width: 580px;
    height: 40px;
    display: block;
}

/* Navigation Bar Styles - Matching FS Website Design (Issue #60) */
.nav-bar {
    width: 100%;
    height: 52px;
    background-color: #6B6B6B; /* Grey to match FS website style */
    box-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 40px; /* Left/Right padding 40px */
    box-sizing: border-box;
}

.nav-content {
    max-width: 1400px; /* Match other content wrappers if needed, or full width */
    width: 100%;
    margin: 0 auto;
}

.nav-home-link {
    color: #FFFFFF;
    font-size: 1rem; /* Assuming standard size, adjust if needed */
    text-decoration: none;
    font-weight: 500;
    opacity: 1;
}

.nav-home-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Success Page Styles */
.success-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.success-container {
    text-align: center;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.success-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.success-icon svg {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-page h1 {
    color: #2d5016;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.success-message {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.submission-details {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    margin: 30px 0;
    text-align: left;
}

.detail-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

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

.detail-label {
    font-weight: 600;
    color: #333;
    margin-right: 12px;
    min-width: 140px;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-size: 14px;
    flex: 1;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.detail-value.status-submitted {
    color: #2d5016;
    font-weight: 600;
}

.detail-value.status-pending {
    color: #856404;
    font-weight: 600;
}

.request-id {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #e0e0e0;
}

.request-id-note {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

/* Home Page Styles */
.home-page {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.home-page h1 {
    font-size: 36px;
    font-weight: 700;
    color: #2d5016;
    margin-bottom: 20px;
    font-family: 'Source Sans Pro', 'Open Sans', Arial, sans-serif;
}

.home-page p {
    font-size: 18px;
    color: #333;
    margin-bottom: 40px;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
    overflow: hidden;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
    text-decoration: none;
}

.btn-link {
    color: #2d5016;
    padding: 12px 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-link:hover {
    color: #1f3a0f;
    text-decoration: underline;
}

.next-steps {
    margin-top: 40px;
    text-align: left;
    background-color: white;
    border-left: 4px solid #2d5016;
    padding: 20px 20px 20px 24px;
    border-radius: 4px;
    overflow: hidden;
}

.next-steps h2 {
    color: #2d5016;
    font-size: 20px;
    margin-bottom: 12px;
}

.next-steps ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.next-steps li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: #333;
    line-height: 1.6;
}

.next-steps li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2d5016;
    font-weight: bold;
}

/* Error Page Styles */
.error-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.error-container {
    text-align: center;
    background-color: #fff5f5;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #fcc;
}

.error-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.error-icon svg {
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-page h1 {
    color: #c00;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.error-message-box {
    background-color: white;
    border: 2px solid #fcc;
    border-left: 4px solid #c00;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.error-message-box .error-message {
    color: #c00;
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
}

.request-id-section {
    margin: 30px 0;
    padding: 20px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.request-id-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.request-id-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    word-break: break-all;
}

.request-id-note {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 8px;
    font-style: italic;
}

.troubleshooting-tips {
    margin-top: 30px;
    text-align: left;
    background-color: white;
    border-left: 4px solid #856404;
    padding: 20px;
    border-radius: 4px;
}

.troubleshooting-tips h2 {
    color: #856404;
    font-size: 20px;
    margin-bottom: 12px;
}

.troubleshooting-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.troubleshooting-tips li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: #333;
    line-height: 1.6;
}

.troubleshooting-tips li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #856404;
    font-weight: bold;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .success-page,
    .error-page {
        padding: 20px 10px;
    }
    
    .success-container,
    .error-container {
        padding: 24px;
    }
    
    .success-page h1,
    .error-page h1 {
        font-size: 24px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-link {
        width: 100%;
        text-align: center;
        min-height: 44px;
        padding: 12px 24px;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-label {
        margin-bottom: 4px;
        min-width: auto;
    }
}

/* Attachment Extraction Results */
.extraction-results-container {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    margin: 1.5rem 0;
    text-align: left;
    border-left: 4px solid #2d5016;
    overflow: hidden;
}

.extraction-results-container.hidden {
    display: none;
}

.extraction-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.extraction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.extraction-icon {
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
}

.extraction-success .extraction-icon {
    color: #10b981;
}

.extraction-failed .extraction-icon {
    color: #f59e0b;
}

.extraction-filename {
    flex: 1;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.extraction-details {
    font-size: 0.875rem;
    color: #6b7280;
}

.extraction-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #1a1a1a;
    font-size: 0.9rem;
}

/* Analysis Results Display */
.analysis-results-container {
    margin: 1.5rem 0;
    text-align: left;
}

.analysis-results-container.hidden {
    display: none;
}

.analysis-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    border-left: 4px solid #2d5016;
    overflow: hidden;
}

.analysis-header {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.analysis-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.analysis-label {
    font-weight: 500;
    color: #4b5563;
    min-width: 120px;
}

.analysis-value {
    color: #1a1a1a;
    flex: 1;
}

.analysis-summary .analysis-value {
    font-style: italic;
    line-height: 1.5;
}

/* Sentiment colors */
.analysis-sentiment-positive {
    color: #059669;
    font-weight: 500;
}

.analysis-sentiment-negative {
    color: #dc2626;
    font-weight: 500;
}

.analysis-sentiment-neutral {
    color: #6b7280;
    font-weight: 500;
}

/* Action required colors */
.action-yes {
    color: #059669;
    font-weight: 500;
}

.action-no {
    color: #6b7280;
    font-weight: 500;
}

/* Mobile responsiveness for analysis card */
@media (max-width: 480px) {
    .analysis-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .analysis-label {
        min-width: unset;
    }
}

/* Additional mobile improvements for very small screens */
@media (max-width: 375px) {
    .content-wrapper {
        padding: 0.75rem;
    }

    .header-content {
        padding: 0.75rem;
    }

    .nav-bar {
        padding: 0 0.75rem;
    }

    .nav-home-link {
        font-size: 0.875rem;
    }
}
