/**
 * PDF Compression Styles
 */

/* Compress Modal */
.compress-modal {
    width: 100%;
    max-width: 700px;
}

.compress-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compress-modal .modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.compress-modal .modal-body {
    padding: 1.5rem;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1rem;
}

.analysis-loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.analysis-icon {
    font-size: 2rem;
}

.analysis-item strong {
    display: block;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.analysis-item p {
    margin: 0;
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
}

.recommendation-box {
    padding: 1rem;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f2ff 100%);
    border-left: 4px solid #667eea;
    border-radius: 6px;
}

.recommendation-box strong {
    color: #495057;
}

.recommendation-box p {
    margin: 0.5rem 0;
    color: #495057;
}

/* Compression Levels */
.compression-levels {
    margin-bottom: 2rem;
}

.compression-levels h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.level-card {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.level-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.level-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f2ff 100%);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px);
}

.level-card.recommended {
    border-color: #28a745;
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.level-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.level-card h5 {
    margin: 0.5rem 0;
    color: #667eea;
    font-size: 1rem;
}

.level-quality {
    margin: 0.3rem 0;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.level-description {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.level-reduction {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #e7f3ff;
    border-radius: 6px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.level-card small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Compression Options */
.compression-options {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.compression-options h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1rem;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Compress Actions */
.compress-actions {
    margin-bottom: 1.5rem;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Progress */
.compress-progress {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #e7f3ff;
    border: 2px solid #667eea;
    border-radius: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

#compressStatusText {
    font-weight: 600;
    color: #495057;
}

#compressStatusPercent {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.progress-bar-compress {
    width: 100%;
    height: 30px;
    background: #dee2e6;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill-compress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
}

/* Results */
.compress-results {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fff4 0%, #e7f3ff 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    animation: slideIn 0.4s ease-out;
}

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

.compress-results h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #28a745;
    text-align: center;
}

.size-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.size-item {
    text-align: center;
}

.size-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.size-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
}

.size-arrow {
    font-size: 2rem;
    color: #28a745;
    font-weight: bold;
}

.reduction-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.reduction-badge {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 12px;
    min-width: 120px;
}

.reduction-badge span:first-child {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.reduction-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.reduction-details {
    flex: 1;
}

.reduction-details p {
    margin: 0.5rem 0;
    color: #495057;
}

.reduction-details strong {
    color: #28a745;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .compress-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .analysis-grid,
    .levels-grid {
        grid-template-columns: 1fr;
    }
    
    .size-comparison {
        flex-direction: column;
        gap: 1rem;
    }
    
    .size-arrow {
        transform: rotate(90deg);
    }
    
    .reduction-info {
        flex-direction: column;
        text-align: center;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .analysis-item,
    .compression-options {
        background: #2a2a2a;
    }
    
    .level-card {
        background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2a 100%);
        border-color: #444;
    }
    
    .level-card.active {
        background: linear-gradient(135deg, #1a2a3a 0%, #2a3a4a 100%);
    }
    
    .size-comparison,
    .reduction-info {
        background: #2a2a2a;
    }
    
    .compress-results {
        background: linear-gradient(135deg, #1a2a1a 0%, #1a2a3a 100%);
    }
}

/* Images to PDF Styles */
.img2pdf-modal { width: 100%; max-width: 650px; }
.img2pdf-upload-area { margin-bottom: 1.5rem; }
.img2pdf-upload-label { display: flex; flex-direction: column; align-items: center; padding: 3rem 2rem; border: 3px dashed #667eea; border-radius: 12px; background: #f8f9ff; cursor: pointer; transition: all 0.3s; }
.img2pdf-upload-label:hover { border-color: #764ba2; background: #f0f2ff; }
.img2pdf-list { margin: 1.5rem 0; padding: 1rem; background: #f8f9fa; border-radius: 8px; }
.img2pdf-list h4 { margin-top: 0; color: #495057; }
#img2pdfContainer { display: flex; flex-direction: column; gap: 0.75rem; }
.img2pdf-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; background: white; border: 2px solid #dee2e6; border-radius: 8px; cursor: move; }
.img2pdf-item:hover { border-color: #667eea; }
.img-number { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #667eea; color: white; border-radius: 50%; font-weight: bold; font-size: 0.85rem; }
.img-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.img-info { flex: 1; }
.img-info strong { display: block; color: #212529; }
.img-info small { color: #6c757d; }
.img2pdf-options { padding: 1rem; background: #f8f9fa; border-radius: 8px; margin: 1rem 0; }
.option-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.option-row label { min-width: 120px; font-weight: 600; color: #495057; }
.img2pdf-actions { margin-top: 1.5rem; }

/* Highlight & Annotate Styles */
.highlight-modal { width: 100%; max-width: 550px; }
.hl-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0; }
.hl-mode-card { padding: 2rem 1rem; background: #f8f9ff; border: 2px solid #dee2e6; border-radius: 12px; text-align: center; cursor: pointer; transition: all 0.3s; }
.hl-mode-card:hover { border-color: #667eea; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2); }
.hl-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.hl-mode-card strong { display: block; margin: 0.5rem 0; color: #667eea; }
.hl-mode-card p { margin: 0; color: #6c757d; font-size: 0.9rem; }
.color-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-btn { width: 60px; height: 40px; border: 2px solid #ddd; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.color-btn:hover { transform: scale(1.1); }
#annotateText { width: 100%; padding: 0.75rem; border: 2px solid #dee2e6; border-radius: 8px; font-size: 1rem; }

/* AI Summary Styles */
.ai-summary-modal { width: 100%; max-width: 650px; }
.ai-info-box { padding: 1rem; background: linear-gradient(135deg, #e7f3ff 0%, #f0f2ff 100%); border-left: 4px solid #667eea; border-radius: 8px; margin-bottom: 1.5rem; }
.ai-info-box p { margin: 0.5rem 0; }
.ai-options { margin-bottom: 1.5rem; }
.ai-result { margin-top: 1.5rem; padding: 1.5rem; background: #f8f9fa; border-radius: 8px; }
.ai-result h4 { margin-top: 0; color: #495057; }
.summary-content { padding: 1rem; background: white; border-radius: 6px; line-height: 1.8; color: #212529; max-height: 400px; overflow-y: auto; }
.ai-stats { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #dee2e6; }
.ai-stats small { color: #6c757d; }
.ai-error { margin-top: 1.5rem; padding: 1rem; background: #fff3cd; border-left: 4px solid #ffc107; border-radius: 8px; }
.ai-error code { background: #fff; padding: 2px 6px; border-radius: 3px; font-family: monospace; }

/* Cloud Storage Styles */
.cloud-modal { width: 100%; max-width: 550px; }
.cloud-providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.cloud-card { padding: 1.5rem 1rem; background: #f8f9ff; border: 2px solid #dee2e6; border-radius: 12px; text-align: center; cursor: pointer; transition: all 0.3s; }
.cloud-card:hover { border-color: #667eea; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2); }
.cloud-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.cloud-card strong { display: block; margin: 0.5rem 0; color: #667eea; }
.cloud-card p { margin: 0; font-size: 0.85rem; color: #6c757d; }
.cloud-note { margin-top: 2rem; padding: 1rem; background: #fff3cd; border-left: 4px solid #ffc107; border-radius: 6px; }
.cloud-note p { margin: 0.5rem 0; font-size: 0.9rem; }
.cloud-note ul { margin: 0.5rem 0; padding-left: 1.5rem; }
.cloud-note code { background: white; padding: 2px 6px; border-radius: 3px; font-family: monospace; }
