/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
}

.upload-area h3 {
    font-size: 1.3rem;
    color: #495057;
    margin: 0;
}

.upload-area p {
    color: #6c757d;
    margin: 0;
}

#fileInput {
    display: none;
}

.upload-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.file-info {
    margin-top: 15px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #2196f3;
}

#clearFile {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#clearFile:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
}

/* Results Section */
.results-section {
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.results-header h2 {
    font-size: 1.8rem;
    color: #495057;
    margin: 0;
}

.toggle-button {
    background: none;
    border: 1px solid #dee2e6;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toggle-button:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.toggle-button.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Visualization Toggle */
.visualization-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    width: fit-content;
}

.view-toggle {
    background: #f8f9fa;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-right: 1px solid #dee2e6;
}

.view-toggle:last-child {
    border-right: none;
}

.view-toggle.active {
    background: #667eea;
    color: white;
}

.view-toggle:not(.active):hover {
    background: #e9ecef;
}

/* Table Styles */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.results-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.results-table tr:nth-child(even) {
    background: #f8f9fa;
}

.results-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.asset-type-cell {
    font-weight: 600;
    color: #495057;
}

.extensions-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #6c757d;
}

.count-cell {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
}

.percentage-cell {
    color: #28a745;
    font-weight: 600;
}

/* Chart Styles */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

#pieChart {
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-text {
    flex: 1;
}

.legend-value {
    font-weight: 600;
    color: #495057;
}

/* Error Section */
.error-section {
    margin-bottom: 40px;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.error-icon {
    width: 48px;
    height: 48px;
    color: #dc3545;
    margin-bottom: 15px;
}

.error-message h3 {
    color: #721c24;
    margin-bottom: 10px;
}

.error-message p {
    color: #721c24;
    margin: 0;
}

/* Instructions Section */
.instructions {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.instructions h2,
.instructions h3 {
    color: #495057;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
    margin-bottom: 30px;
}

.instructions li {
    margin-bottom: 8px;
    color: #6c757d;
}

.supported-types {
    margin-top: 30px;
}

.asset-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.asset-type {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.asset-type strong {
    display: block;
    color: #495057;
    margin-bottom: 5px;
}

.asset-type span {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .results-header h2 {
        text-align: center;
    }

    .toggle-button {
        justify-content: center;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .chart-container {
        flex-direction: column;
        gap: 20px;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 10px 8px;
    }

    .asset-types-grid {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .upload-content {
        gap: 10px;
    }

    .upload-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .results-table,
    .results-table thead,
    .results-table tbody,
    .results-table th,
    .results-table td,
    .results-table tr {
        display: block;
    }

    .results-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .results-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }

    .results-table td {
        border: none;
        position: relative;
        padding: 8px 8px 8px 50%;
        text-align: left;
    }

    .results-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #495057;
    }
}

/* Animation for results appearing */
.results-content {
    animation: slideIn 0.5s ease-out;
}

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

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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