* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #FAFAFA;
    color: #000000;
    line-height: 1.6;
    font-weight: 300;
    min-height: 100vh;
}

/* Header */
.header {
    background: #000000;
    padding: 32px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid #000000;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header-left p {
    font-size: 15px;
    font-weight: 300;
    opacity: 0.9;
}

.header-right {
    text-align: right;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-right a {
    color: white;
    text-decoration: none;
    font-weight: 300;
    border-bottom: 1px solid white;
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.header-right a:hover {
    opacity: 0.6;
}

/* Back Link */
.back-link {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.back-link:hover {
    color: #ffffff;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
}

.main-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 0;
    min-height: calc(100vh - 100px);
}

/* Input Panel */
.input-panel {
    padding: 48px 24px;
    border-right: 1px solid #E0E0E0;
    background: #FAFAFA;
    overflow-y: auto;
}

/* Results Panel */
.results-panel {
    padding: 48px 40px;
    background: white;
    overflow-y: auto;
}

/* Panel Title */
.panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

/* Labels */
label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 24px;
    color: #000000;
    font-size: 14px;
    letter-spacing: -0.01em;
}

label:first-of-type {
    margin-top: 0;
}

/* Inputs */
select, textarea, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #000000;
    border-radius: 0;
    font-size: 15px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    transition: border-color 0.2s;
    background: white;
}

select:focus, textarea:focus, input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #0039A6;
}

/* Or Divider */
.or-divider {
    text-align: center;
    margin: 32px 0 24px 0;
    position: relative;
}

.or-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #E0E0E0;
}

.or-divider span {
    position: relative;
    background: #FAFAFA;
    padding: 0 16px;
    font-size: 13px;
    color: #666666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* File Upload Area */
.file-upload-area {
    position: relative;
    border: 2px dashed #000000;
    border-radius: 0;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    margin-top: 8px;
}

.file-upload-area:hover {
    border-color: #0039A6;
    background: #FAFAFA;
}

.file-upload-area.dragover {
    background: #E8F0FF;
    border-color: #0039A6;
}

.file-upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    border: none;
}

.upload-prompt {
    pointer-events: none;
}

.upload-prompt p {
    margin: 5px 0;
    font-size: 15px;
    color: #000000;
    font-weight: 300;
}

.file-types {
    font-size: 13px;
    color: #666666;
}

.file-name {
    margin-top: 8px;
    font-size: 13px;
    color: #0039A6;
    font-weight: 300;
}

/* Buttons */
button {
    width: 100%;
    padding: 16px;
    background: #0039A6;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 32px;
    letter-spacing: -0.01em;
}

button:hover:not(:disabled) {
    background: #002E80;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #0039A6;
    border: 1px solid #0039A6;
    margin-top: 0;
}

.btn-secondary:hover {
    background: #0039A6;
    color: white;
}

/* Export Section - BELOW Analyze Another */
.export-section {
    margin-top: 32px;
}

.export-title {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-export {
    background: #0039A6;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    padding: 12px 8px;
    margin: 0;
    letter-spacing: -0.01em;
}

.btn-export:hover {
    background: #002E80;
}

/* Loading - Now on RIGHT side */
.loading {
    display: none;
    text-align: center;
    padding: 80px 40px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #E0E0E0;
    border-top: 3px solid #0039A6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px auto;
}

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

.loading p {
    font-size: 15px;
    color: #666666;
    font-weight: 300;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-state .panel-title {
    text-align: center;
}

.magnifying-glass {
    width: 180px;
    height: 180px;
    margin: 40px auto;
}

.empty-state-text {
    font-size: 15px;
    line-height: 1.7;
    color: #000000;
    font-weight: 300;
    margin: 24px 0 16px 0;
}

.empty-state-subtext {
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
    font-weight: 300;
}

/* Document Preview - ALIGNED with button bottom */
.document-preview {
    padding-top: 0;
}

.preview-box {
    background: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 24px;
    margin: 24px 0 0 0;
    display: flex;
    flex-direction: column;
    height: 515px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #E0E0E0;
    flex-shrink: 0;
}

.preview-filename {
    font-weight: 700;
    color: #0039A6;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.preview-filesize {
    font-size: 13px;
    color: #666666;
    font-weight: 300;
}

.preview-text {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333333;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-weight: 300;
    overflow-y: auto;
    flex: 1;
}

.preview-note {
    text-align: center;
    color: #666666;
    font-size: 14px;
    margin-top: 16px;
    font-weight: 300;
    flex-shrink: 0;
}

/* Results */
.results {
    padding-top: 0;
}

/* Summary Cards - BOLD AND PROMINENT */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 32px 0 40px 0;
    width: calc(96% + 20px);
}

.summary-card {
    background: #FAFAFA;
    padding: 32px 24px;
    border-radius: 0;
    text-align: center;
}

.summary-card.critical {
    border: 3px solid #DC143C;
}

.summary-card.gap {
    border: 3px solid #ffc107;
}

.summary-card.met {
    border: 3px solid #28a745;
}

.summary-card h3 {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000000;
    margin-bottom: 16px;
}

.card-icon {
    font-size: 56px;
    margin-bottom: 12px;
    display: block;
}

.summary-card.critical .card-icon {
    color: #DC143C;
}

.summary-card.gap .card-icon {
    color: #ffc107;
}

.summary-card.met .card-icon {
    color: #28a745;
}

.metric-value {
    font-size: 48px;
    font-weight: 300;
    color: #000000;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.metric-subtitle {
    font-size: 14px;
    color: #000000;
    font-weight: 700;
}

/* Carousel - SIMPLE TWO CARD LAYOUT */
.carousel-section {
    margin-top: 48px;
}

.carousel-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.carousel-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    width: 48%;
    flex-shrink: 0;
    flex-grow: 0;
    padding: 32px;
    border: 2px solid;
    border-radius: 0;
    margin-right: 20px;
}

.carousel-slide:last-child {
    margin-right: 0;
}

/* CRITICAL - Red background */
.carousel-slide.critical {
    background: #ffe6e6;
    border-color: #DC143C;
}

/* GAP - Yellow background */
.carousel-slide.gap {
    background: #fff9e6;
    border-color: #ffc107;
}

/* MET - Green background */
.carousel-slide.met {
    background: #e6f4ea;
    border-color: #28a745;
}

.slide-content {
    width: 100%;
}

.slide-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.slide-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.carousel-slide.critical .slide-badge {
    background-color: #DC143C;
    color: white;
}

.carousel-slide.gap .slide-badge {
    background-color: #ffc107;
    color: #000000;
}

.carousel-slide.met .slide-badge {
    background-color: #28a745;
    color: white;
}

.slide-content h4 {
    font-size: 16px;
    margin: 0;
    color: #000000;
    font-weight: 700;
    letter-spacing: -0.01em;
    flex: 1;
}

.slide-content p {
    margin: 12px 0;
    color: #000000;
    line-height: 1.7;
    font-size: 14px;
    font-weight: 300;
}

.slide-content p strong {
    font-weight: 700;
}

.slide-recommendation {
    background-color: white;
    padding: 16px;
    border: 1px solid #E0E0E0;
    border-radius: 0;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 300;
}

.slide-recommendation strong {
    font-weight: 700;
}

.slide-evidence {
    font-style: italic;
    color: #666666;
    padding-left: 16px;
    border-left: 3px solid #999999;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
}

/* Carousel Controls */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding: 24px 0;
}

.carousel-btn {
    background: #0039A6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.carousel-btn:hover:not(:disabled) {
    background: #002E80;
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: #bbb;
}

.carousel-dot.active {
    background: #0039A6;
    width: 30px;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .input-panel {
        border-right: none;
        border-bottom: 1px solid #E0E0E0;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .carousel-slide {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-right {
        align-items: flex-start;
    }
    
    .input-panel,
    .results-panel {
        padding: 32px 24px;
    }
    
    .carousel-slide {
        padding: 24px;
    }
}

/* ============================================
   PRINT STYLES - PROFESSIONAL PDF EXPORT
   ============================================ */

@media print {
    /* HIDE UI ELEMENTS */
    .header,
    .input-panel,
    #postAnalysisActions,
    .carousel-controls,
    .carousel-btn,
    .carousel-dots,
    .empty-state,
    .loading {
        display: none !important;
    }
    
    /* RESET PAGE STRUCTURE */
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    
    .main-layout {
        display: block !important;
        grid-template-columns: 1fr !important;
    }
    
    .results-panel {
        padding: 30px 40px !important;
        background: white !important;
    }
    
    /* PAGE SETUP */
    @page {
        size: letter;
        margin: 0.6in;
    }
    
    /* PRESERVE ALL COLORS */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* SUMMARY CARDS - PRESERVE COLORS AND HORIZONTAL LAYOUT */
    .summary-cards {
        margin: 16px 0 24px 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
        gap: 12px !important;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .summary-card {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none !important;
        padding: 16px 12px !important;
    }
    
    .summary-card.critical {
        border: 2px solid #DC143C !important;
        background: #FAFAFA !important;
    }
    
    .summary-card.gap {
        border: 2px solid #ffc107 !important;
        background: #FAFAFA !important;
    }
    
    .summary-card.met {
        border: 2px solid #28a745 !important;
        background: #FAFAFA !important;
    }
    
    .summary-card h3 {
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }
    
    .card-icon {
        font-size: 28px !important;
        margin-bottom: 6px !important;
    }
    
    .metric-value {
        font-size: 32px !important;
        margin-bottom: 4px !important;
    }
    
    .metric-subtitle {
        font-size: 11px !important;
    }
    
    /* CAROUSEL TO VERTICAL GRID */
    .carousel-section {
        margin-top: 20px !important;
    }
    
    .carousel-container {
        overflow: visible !important;
    }
    
    .carousel-track {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        transform: none !important;
    }
    
    .carousel-slide {
        min-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none !important;
        padding: 20px !important;
    }
    
    /* PRESERVE FINDING CARD COLORS */
    .carousel-slide.critical {
        background: #ffe6e6 !important;
        border: 2px solid #DC143C !important;
    }
    
    .carousel-slide.gap {
        background: #fff9e6 !important;
        border: 2px solid #ffc107 !important;
    }
    
    .carousel-slide.met {
        background: #e6f4ea !important;
        border: 2px solid #28a745 !important;
    }
    
    /* BADGE COLORS */
    .carousel-slide.critical .slide-badge {
        background-color: #DC143C !important;
        color: white !important;
    }
    
    .carousel-slide.gap .slide-badge {
        background-color: #ffc107 !important;
        color: #000000 !important;
    }
    
    .carousel-slide.met .slide-badge {
        background-color: #28a745 !important;
        color: white !important;
    }
    
    /* TYPOGRAPHY ADJUSTMENTS */
    .panel-title {
        font-size: 20px !important;
        margin-bottom: 12px !important;
        margin-top: 0 !important;
    }
    
    .carousel-section h3 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
        margin-top: 0 !important;
    }
    
    .slide-content h4 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .slide-header {
        margin-bottom: 8px !important;
        gap: 8px !important;
    }
    
    .slide-content p {
        font-size: 11px !important;
        line-height: 1.5 !important;
        margin: 8px 0 !important;
    }
    
    .slide-badge {
        font-size: 9px !important;
        padding: 3px 6px !important;
    }
    
    /* SPACING ADJUSTMENTS */
    .slide-recommendation {
        background-color: white !important;
        border: 1px solid #cccccc !important;
        font-size: 11px !important;
        padding: 12px !important;
        margin-top: 8px !important;
    }
    
    .slide-evidence {
        font-size: 10px !important;
        margin-top: 8px !important;
        padding-left: 12px !important;
    }
    
    /* ADD FOOTER TO EACH PAGE */
    @page {
        @bottom-center {
            content: "Generated by Compliance Lens | Built by Mike Burns";
            font-size: 9px;
            color: #666666;
        }
        
        @bottom-right {
            content: "Page " counter(page);
            font-size: 9px;
            color: #666666;
        }
    }
}
