/* ====================================================
   PDF DPI Analyzer - Complete Styles
   Version: 3.0 - Centered Layout
===================================================== */

/* ===== Container Base ===== */
.tool-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}



/* ===== File Preview Area - Centered ===== */
.file-preview-area {
    display: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin: 0 auto 1.5rem;
    border: 2px solid #e5e7eb;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    max-width: 700px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.file-preview-area.show {
    display: flex;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview-area:hover {
    border-color: #00008B;
    box-shadow: 0 4px 16px rgba(0, 0, 139, 0.1);
}

.file-preview-icon {
    flex-shrink: 0;
    width: 60px;
    height: 72px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.file-preview-icon i {
    font-size: 2.8rem;
    color: #dc3545;
}

.file-preview-icon .file-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00008B;
    color: white;
    font-size: 0.55rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 139, 0.3);
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-info .file-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-preview-info .file-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.file-preview-info .file-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.file-preview-info .file-meta i {
    font-size: 0.75rem;
    color: #00008B;
}

.file-preview-progress {
    width: 100%;
    margin-top: 0.5rem;
}

.file-preview-progress .progress-track {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.file-preview-progress .progress-track .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00008B, #4cc9f0);
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
}

.file-preview-progress .progress-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.file-preview-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.file-preview-actions .btn-analyze {
    background: #00008B;
    border: 1px solid #00008B;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.file-preview-actions .btn-analyze:hover:not(:disabled) {
    background: #000066;
    border-color: #000066;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 139, 0.3);
}

.file-preview-actions .btn-analyze:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-preview-actions .btn-remove {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.file-preview-actions .btn-remove:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===== Results Container - Centered ===== */
.result-box {
    margin-top: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Summary Cards - Centered Grid ===== */
[data-role="summary"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem auto;
    max-width: 800px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.summary-card h3 {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00008B;
    margin: 0;
}

/* ===== Warning Alert - Centered ===== */
.alert-warning {
    max-width: 800px;
    margin: 1.5rem auto;
}

/* ===== Results Table - Centered ===== */
.results-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem auto;
    max-width: 900px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.results-table thead {
    background: #f8f9fa;
}

.results-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.results-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.results-table tbody tr:hover {
    background: rgba(0, 0, 139, 0.04);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Action Buttons - Centered ===== */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Start Over Button ===== */
.btn-start-over-outline-danger {
    background: transparent;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-start-over-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===== Export Button ===== */
.btn-export {
    background: #00008B;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover:not(:disabled) {
    background: #000066;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 139, 0.3);
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== DPI Indicators ===== */
.dpi-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.dpi-low { 
    background: #f72585; 
    box-shadow: 0 0 8px rgba(247, 37, 133, 0.3);
}

.dpi-medium { 
    background: #f8961e;
    box-shadow: 0 0 8px rgba(248, 150, 30, 0.3);
}

.dpi-high { 
    background: #4cc9f0;
    box-shadow: 0 0 8px rgba(76, 201, 240, 0.3);
}

/* ===== Info Alert ===== */
.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 800px;
    margin: 1.5rem auto;
}

.alert-info i {
    font-size: 1.25rem;
    color: #17a2b8;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    [data-role="summary"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .tool-wrapper {
        padding: 0 1rem;
    }
    
    .file-preview-area {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
        max-width: 100%;
    }
    
    .file-preview-info .file-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .file-preview-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .file-preview-actions .btn-analyze,
    .file-preview-actions .btn-remove {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    
    [data-role="summary"] {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .summary-card {
        padding: 1rem 0.75rem;
    }
    
    .summary-card p {
        font-size: 1.4rem;
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }
    
    .action-buttons .btn-start-over-outline-danger,
    .action-buttons .btn-export {
        width: 100%;
        justify-content: center;
    }
    
    .upload-area {
        padding: 2rem 1rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .tool-wrapper {
        padding: 0 0.5rem;
    }
    
    [data-role="summary"] {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .file-preview-area {
        padding: 0.75rem;
    }
    
    .file-preview-icon {
        width: 48px;
        height: 56px;
    }
    
    .file-preview-icon i {
        font-size: 2rem;
    }
    
    .file-preview-actions .btn-analyze,
    .file-preview-actions .btn-remove {
        min-width: 100%;
        justify-content: center;
    }
    
    .results-table {
        font-size: 0.75rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.35rem 0.5rem;
    }
    
    .summary-card p {
        font-size: 1.2rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .upload-area,
    .file-preview-area,
    .action-buttons,
    .progress-container,
    .loading,
    .alert-info {
        display: none !important;
    }
    
    .result-box {
        margin-top: 0;
        max-width: 100%;
    }
    
    [data-role="summary"] {
        max-width: 100%;
    }
    
    .results-table th {
        background: #e9ecef !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .dpi-indicator {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}