/* Base Styles */
:root {
    --primary-color: #4a6cf7;
    --primary-dark: #3a5ce5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --body-bg: #f5f7ff;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e1e5ee;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.progress-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 8px;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Navigation Panel */
.nav-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--card-bg);
    box-shadow: 2px 0 10px var(--shadow-color);
    z-index: 100;
    transition: left var(--transition-speed);
}

.nav-panel.open {
    left: 0;
}

.nav-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.nav-content {
    padding: 1rem 0;
}

.nav-content ul li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    transition: background-color var(--transition-speed);
}

.nav-content ul li a:hover,
.nav-content ul li a.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.nav-content ul li a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.content-wrapper {
    flex: 1;
    transition: margin-left var(--transition-speed);
}

header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
    color: var(--text-color);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

footer {
    background-color: var(--card-bg);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* Hero Section */
.hero {
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    text-align: center;
    transition: transform var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.upload-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.file-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background-color: var(--light-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: border-color var(--transition-speed);
}

.file-input-label:hover {
    border-color: var(--primary-color);
}

.file-input-label i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.file-name {
    margin-top: 1rem;
    color: var(--secondary-color);
}

.options-group {
    margin-top: 2rem;
}

.options-group h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.checkbox-group {
    margin-bottom: 0.75rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label {
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    color: white;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}

.secondary-btn:hover {
    background-color: #5a6268;
    color: white;
}

/* How It Works Section */
.how-it-works {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.step {
    text-align: center;
    padding: 1rem;
}

.step-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.step h3 {
    margin-bottom: 0.75rem;
}

/* Results Page */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.results-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background-color: var(--light-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-color);
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.item-card:hover {
    transform: translateY(-5px);
}

.item-preview {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    overflow: hidden;
}

.item-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--secondary-color);
}

.file-icon.large {
    font-size: 5rem;
}

.file-ext {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.item-info {
    padding: 1rem;
}

.item-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.no-results h2 {
    margin-bottom: 1rem;
}

.no-results p {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-image-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 60vh;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.modal-info p {
    color: var(--secondary-color);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tool-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 10px var(--shadow-color);
    text-align: center;
    transition: transform var(--transition-speed);
}

.tool-card:hover {
    transform: translateY(-10px);
}

.tool-icon {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.tool-card h2 {
    margin-bottom: 1rem;
}

.tool-card p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }
}
