/* Images to PDF Converter Styles */
:root {
    --primary-color: #dc2626;
    --primary-hover: #b91c1c;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
}

/* Container */
.image-to-pdf-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border-bottom: 3px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 26px;
    opacity: 0.3;
    filter: blur(10px);
    z-index: -1;
}

.icon-wrapper i {
    font-size: 3rem;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

.header-text {
    text-align: left;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.page-description {
    font-size: 1.2rem;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

/* Converter Card */
.converter-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

/* Upload Section */
.upload-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #6b7280;
    font-size: 1.1rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    background: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.03);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-content * {
    pointer-events: none;
}

.upload-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.upload-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.btn-browse {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.btn-browse:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Image Preview Section */
.image-preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.preview-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.btn-clear {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.btn-clear:hover {
    background: var(--primary-color);
    color: white;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.image-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: white;
    border: 2px solid var(--border-color);
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-item-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem;
}

.btn-remove {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-remove:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.image-item-footer {
    padding: 0.75rem;
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
}

.image-item-name {
    font-size: 0.85rem;
    color: var(--dark-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.image-item-size {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

/* Settings Section */
.settings-section {
    animation: fadeIn 0.5s ease-out;
    margin-top: 2rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 2rem;
}

.settings-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-card {
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.setting-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.setting-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.setting-header label {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.05rem;
    margin: 0;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.setting-hint {
    display: block;
    color: #9ca3af;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Action Section */
.action-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.btn-convert {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-convert i {
    font-size: 1.5rem;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spinner-ring {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(220, 38, 38, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.spinner-text p {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.progress-info {
    background: rgba(220, 38, 38, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: inline-block;
}

.progress-label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left i {
    font-size: 2.5rem;
    color: var(--success-color);
}

.header-left h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--dark-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border: none;
    font-size: 1rem;
}

.btn-download {
    background: var(--primary-color);
    color: white;
}

.btn-download:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-new {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-new:hover {
    background: var(--primary-color);
    color: white;
}

/* Result Summary */
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.summary-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.summary-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.summary-details {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-color);
}

/* Download Info */
.download-info {
    margin-top: 2rem;
}

.info-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 2px solid var(--success-color);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-box i {
    font-size: 2rem;
    color: var(--success-color);
    flex-shrink: 0;
}

.info-box strong {
    display: block;
    color: var(--dark-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.info-box p {
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s ease-out;
    border: 1px solid;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.alert i {
    font-size: 1.5rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Info Section */
.info-section {
    margin-top: 4rem;
}

.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border-color);
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.info-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.info-card:hover .info-icon {
    transform: scale(1.1) rotate(5deg);
}

.info-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.info-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.info-card p {
    color: #6b7280;
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
    }

    .header-text {
        text-align: center;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .alert-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
