/* ========================================
   Global Styles & Reset
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    padding: 0;
    margin: 0;
}

.wrapper {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    gap: 0px;       
    width: 100%;
    min-height: 100vh;
}

/* ========================================
   Header & Logo Section
   ======================================== */

.header-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
}

.image-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 8px 16px;
    width: 100%;
}

.logo-left {
    flex: 1;
    min-width: 200px;
}

.logo-left img {
    width: clamp(150px, 20vw, 220px);
    height: auto;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-left img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.powered-by-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.powered-by-box:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.powered-by-text {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    white-space: nowrap;
}

.powered-by-box .logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.powered-by-box .logo-link:hover {
    transform: scale(1.05);
}

.powered-by-box img {
    width: clamp(100px, 14vw, 130px);
    height: auto;
    display: block;
}

/* ========================================
   Main Content Container
   ======================================== */

.main-content {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 40px 20px 60px 20px;
    flex-grow: 1;
}

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

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
    margin-bottom: 50px;
}

.main-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #718096;
    margin-bottom: 20px;
    font-weight: 400;
}

.divider-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto;
    border-radius: 2px;
}

/* ========================================
   Tool Cards
   ======================================== */

.tools-grid {
    margin-bottom: 30px;
}

.tool-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.card-compress:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
}

.card-validate:hover {
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
}

.card-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.tool-card:hover .card-icon-wrapper {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

.card-icon-wrapper i {
    font-size: 36px;
    color: #ffffff;
}

.card-content {
    flex-grow: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.card-description {
    font-size: 1rem;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-size: 0.95rem;
    padding: 8px 0;
}

.feature-list li i {
    color: #48bb78;
    font-weight: bold;
}

.card-action {
    margin-top: auto;
}

/* ========================================
   Custom Buttons
   ======================================== */

.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

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

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-custom i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.btn-custom:hover i {
    transform: translateX(4px);
}

/* ========================================
   Footer Info
   ======================================== */

.footer-info {
    margin-top: 40px;
    padding: 20px;
}

.info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #718096;
    font-size: 0.95rem;
    background: rgba(102, 126, 234, 0.05);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.info-text i {
    color: #667eea;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 992px) {
    .main-content {
        padding: 30px 15px;
    }
    
    .tool-card {
        padding: 24px 20px;
    }
    
    .hero-section {
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }
    
    .header-section {
        padding: 15px;
    }
    
    .image-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 12px 16px;
    }
    
    .logo-left {
        width: 100%;
        text-align: center;
    }
    
    .logo-left img {
        margin: 0 auto;
    }
    
    .powered-by-box {
        width: 100%;
        max-width: 280px;
    }
    
    .main-content {
        padding: 20px 10px 40px 10px;
    }
    
    .tool-card {
        padding: 20px 16px;
        margin-bottom: 20px;
    }
    
    .card-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .card-icon-wrapper i {
        font-size: 30px;
    }
    
    .btn-custom {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .feature-list li {
        font-size: 0.9rem;
        padding: 6px 0;
    }
}

/* ========================================
   Legacy Styles for Other Pages (compress.html, validate.html)
   ======================================== */

/* Page-specific styles */
.compress-page {
    background: #f8f9fa;
}

.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.page-title i {
    color: #667eea;
    font-size: clamp(2rem, 4.5vw, 2.8rem);
}

.page-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: #718096;
    margin-bottom: 20px;
}

.compress-content {
    margin-bottom: 30px;
}

.section-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #667eea;
}

/* Dropzone Styles */
.dropzone {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 280px;
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
    cursor: pointer;
    position: relative;
}

.dropzone:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 64px !important;
    color: #667eea;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.dropzone:hover .upload-icon {
    transform: scale(1.1);
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 8px 0;
}

.dropzone-hint {
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

.dropzone-hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.02);
}

#fileList {
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 20px;
    border: none;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    max-width: 100%;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    margin: 6px 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.file-item:hover {
    background: rgba(102, 126, 234, 0.08);
}

.fixed-size-span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2d3748;
    font-size: 0.9rem;
}

.close-button {
    flex: 0 0 auto;
    margin-left: 10px;
    cursor: pointer;
    color: #e53e3e;
    transition: all 0.2s ease;
}

.close-button:hover {
    color: #c53030;
    transform: scale(1.2);
}

/* Hidden file input */
#files {
    display: none;
}

/* Compression Options */
.option-card {
    border: 2px solid #e2e8f0;
    padding: 16px 20px;
    margin: 12px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.option-card:hover {
    background: #f7fafc;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.option-card input {
    display: none;
}

.option-card input:checked + .option-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin-left: -4px;
    border-radius: 6px;
}

.option-content {
    flex-grow: 1;
    padding: 4px 0;
}

.option-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-icon {
    font-size: 20px !important;
    color: #667eea;
}

.option-subtitle {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

.checkmark {
    display: none;
    color: #48bb78;
    font-size: 24px;
    font-weight: bold;
    margin-left: 12px;
}

.option-card input:checked ~ .checkmark {
    display: inline;
}

/* Process Button */
.process-button-wrapper {
    margin-top: 24px;
    text-align: center;
}

.process-button-wrapper .btn-custom {
    min-width: 200px;
}

/* Output Section */
.output-card {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.03) 0%, rgba(56, 161, 105, 0.03) 100%);
    border: 2px solid rgba(72, 187, 120, 0.2);
}

.output-card .section-title i {
    color: #48bb78;
}

#outputSection {
    display: none;
}

#outputSection.show {
    display: block;
}

.download-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.download-buttons .btn-custom {
    min-width: 200px;
}

#downloadZip,
#downloadSeparately {
    display: none;
}

#downloadZip.show,
#downloadSeparately.show {
    display: inline-flex;
}

/* Loading Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-text {
    color: white;
    font-size: 1.5rem;
    margin-top: 20px;
    font-weight: 500;
}

/* Legacy compatibility */
.process-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; /* Takes the full height of the column */
    min-height: 300px; /* Ensure it doesn't overlap the dropzone on smaller screens */
    margin-bottom: 20px;
}

.output {
    width: 300px;
}

.process-button {
    margin: 0 20px;
    height: 40px;
}

.download-separately {
    margin-top: 10px;
}

#fileList {
    width: 100%;
    max-height: 150px; /* Limit the height of the file list */
    overflow-y: auto; /* Enable scrolling for the file list */
    margin-top: 10px; /* Add some spacing from the upload icon and text */
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-item span {
    flex-grow: 1; /* Make file name take up available space */
}

.file-item i {
    cursor: pointer;
    color: red;
    margin-left: 10px;
}

.option-card {
  border: 1px solid #ddd;
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.option-card:hover {
  background: #f9f9f9;
}
.option-card input {
  display: none;
}
.option-card input:checked + .option-content {
  background: #f3f0ff;
  border-left: 4px solid #6200ea;
}
.option-title {
  font-weight: bold;
}
/* Legacy compatibility */
.process-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 300px;
    margin-bottom: 20px;
}

.output {
    width: 100%;
    max-width: 400px;
}

.process-button {
    margin: 0 20px;
    height: 40px;
}

.download-separately {
    margin-top: 10px;
}

/* Back link hover */
.logo-left a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.logo-left a:hover {
    opacity: 0.8;
}

/* ========================================
   Validate Page Specific Styles
   ======================================== */

.validate-page {
    background: #f8f9fa;
}

.validate-content {
    margin-bottom: 30px;
}

.results-card {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.03) 0%, rgba(49, 130, 206, 0.03) 100%);
    border: 2px solid rgba(66, 153, 225, 0.2);
}

.results-card .section-title i {
    color: #4299e1;
}

#resultsSection {
    display: none;
}

#resultsSection.show {
    display: block;
}

.validation-results {
    margin-top: 20px;
}

/* Result items styling */
.result-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    border-left: 4px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-item.success {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.02) 0%, rgba(255, 255, 255, 1) 100%);
}

.result-item.error {
    border-left-color: #f56565;
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.02) 0%, rgba(255, 255, 255, 1) 100%);
}

.result-item.warning {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.02) 0%, rgba(255, 255, 255, 1) 100%);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.result-filename {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.result-status.success {
    background: #c6f6d5;
    color: #22543d;
}

.result-status.error {
    background: #fed7d7;
    color: #742a2a;
}

.result-status.warning {
    background: #feebc8;
    color: #7c2d12;
}

.result-status i {
    font-size: 18px;
}

.result-details {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 8px;
}

.result-message {
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #4a5568;
}

/* Empty state */
.empty-results {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

.empty-results i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-results p {
    font-size: 1.1rem;
}

/* ========================================
   Validation Messages Styles
   ======================================== */

.validation-messages {
    margin-top: 15px;
}

.validation-messages details {
    margin-top: 10px;
}

.validation-messages summary {
    background: rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.validation-messages summary:hover {
    background: rgba(0, 0, 0, 0.06);
}

.validation-messages details[open] summary {
    border-bottom: 2px solid rgba(244, 67, 54, 0.2);
    border-radius: 6px 6px 0 0;
}

/* Scrollbar styling for error list */
.validation-messages div[style*="overflow-y"] {
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 67, 54, 0.3) rgba(0, 0, 0, 0.05);
}

.validation-messages div[style*="overflow-y"]::-webkit-scrollbar {
    width: 8px;
}

.validation-messages div[style*="overflow-y"]::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.validation-messages div[style*="overflow-y"]::-webkit-scrollbar-thumb {
    background: rgba(244, 67, 54, 0.3);
    border-radius: 4px;
}

.validation-messages div[style*="overflow-y"]::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 67, 54, 0.5);
}

/* Card title with icon */
.card-title i {
    vertical-align: middle;
    margin-right: 8px;
}
