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

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

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

body.dark-mode .storage-card,
body.dark-mode .analysis-container,
body.dark-mode .trends-container,
body.dark-mode .settings-container,
body.dark-mode .faq-container {
    background: rgba(52, 73, 94, 0.9);
    color: #ecf0f1;
}

body.dark-mode .nav-item {
    color: #bdc3c7;
}

body.dark-mode .nav-item.active {
    color: #2196F3;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .app-header {
    background: rgba(44, 62, 80, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2196F3;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.lang-toggle,
.refresh-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.lang-toggle:hover,
.refresh-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

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

/* Storage Overview */
.storage-overview {
    display: grid;
    gap: 1.5rem;
}

.storage-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.storage-card h2 {
    margin-bottom: 1.5rem;
    color: #2196F3;
    font-size: 1.25rem;
}

/* Storage Ring */
.storage-visual {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.storage-ring {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        #2196F3 0deg 90deg,
        #4CAF50 90deg 180deg,
        #FFC107 180deg 270deg,
        #F44336 270deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.storage-ring::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    background: inherit;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
}

body.dark-mode .storage-ring::before {
    background: rgba(52, 73, 94, 0.95);
}

.storage-center {
    position: relative;
    z-index: 2;
    text-align: center;
}

.storage-used {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2196F3;
}

.storage-total {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

body.dark-mode .storage-total {
    color: #bdc3c7;
}

/* Storage Breakdown */
.storage-breakdown {
    display: grid;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.breakdown-item:hover {
    background: rgba(33, 150, 243, 0.1);
}

.breakdown-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.breakdown-size {
    margin-left: auto;
    font-weight: 600;
    color: #2196F3;
}

/* Quick Actions */
.quick-actions {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: #2196F3;
    font-size: 1.1rem;
}

.action-buttons {
    display: grid;
    gap: 0.75rem;
}

.action-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}

.action-btn.secondary {
    background: #4CAF50;
}

.action-btn.secondary:hover {
    background: #388E3C;
}

.action-btn.danger {
    background: #F44336;
}

.action-btn.danger:hover {
    background: #D32F2F;
}

/* Analysis Section */
.analysis-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.analysis-header h2 {
    color: #2196F3;
    font-size: 1.25rem;
}

.scan-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.scan-btn:hover {
    background: #388E3C;
    transform: translateY(-2px);
}

.scan-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Progress Bar */
.scan-progress {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #4CAF50);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

body.dark-mode .progress-text {
    color: #bdc3c7;
}

/* Analysis Results */
.analysis-results {
    display: grid;
    gap: 1.5rem;
}

.large-files-section,
.duplicates-section {
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

.large-files-section h3,
.duplicates-section h3 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.files-list {
    display: grid;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: rgba(33, 150, 243, 0.1);
    transform: translateX(4px);
}

.file-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-path {
    font-size: 0.8rem;
    color: #666;
}

body.dark-mode .file-path {
    color: #bdc3c7;
}

.file-size {
    font-weight: 600;
    color: #2196F3;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

body.dark-mode .empty-state {
    color: #bdc3c7;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Trends Section */
.trends-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.trends-container h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.trends-controls {
    margin-bottom: 1.5rem;
}

.trends-select {
    background: white;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

body.dark-mode .trends-select {
    background: #34495e;
    border-color: #5a6c7d;
    color: #ecf0f1;
}

.trends-chart {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .trends-chart {
    background: #2c3e50;
    border-color: #5a6c7d;
}

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

/* Insights */
.trends-insights h3,
.predictions h3 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.insights-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.insight-item i {
    color: #4CAF50;
    margin-top: 0.25rem;
}

/* Predictions */
.prediction-cards {
    display: grid;
    gap: 1rem;
}

.prediction-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    border-left: 4px solid #FFC107;
}

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

.prediction-content h4 {
    margin-bottom: 0.5rem;
    color: #2196F3;
}

.prediction-time {
    font-size: 0.9rem;
    color: #666;
}

body.dark-mode .prediction-time {
    color: #bdc3c7;
}

/* Settings Section */
.settings-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-container h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group h3 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .setting-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 500;
}

.setting-item input[type="number"],
.setting-item select {
    background: white;
    border: 1px solid #ddd;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 120px;
}

body.dark-mode .setting-item input[type="number"],
body.dark-mode .setting-item select {
    background: #34495e;
    border-color: #5a6c7d;
    color: #ecf0f1;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.setting-actions {
    display: grid;
    gap: 0.75rem;
}

/* FAQ Section */
.faq-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-section h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.faq-container {
    display: grid;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: rgba(33, 150, 243, 0.05);
}

.faq-icon {
    font-size: 1.2rem;
    color: #2196F3;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1rem 1rem 1rem;
    color: #666;
    line-height: 1.6;
}

body.dark-mode .faq-answer {
    color: #bdc3c7;
}

.faq-answer[hidden] {
    display: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 1000;
}

body.dark-mode .bottom-nav {
    background: rgba(44, 62, 80, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
}

.nav-item:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.nav-item.active {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .storage-overview {
        grid-template-columns: 2fr 1fr;
    }
    
    .action-buttons {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .analysis-results {
        grid-template-columns: 1fr 1fr;
    }
    
    .prediction-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .setting-actions {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .faq-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
    
    .storage-card,
    .quick-actions,
    .analysis-container,
    .trends-container,
    .settings-container,
    .faq-section {
        padding: 2rem;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.scanning {
    animation: pulse 2s infinite;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #2196F3;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
button:focus,
.nav-item:focus,
.faq-question:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .storage-card,
    .quick-actions,
    .analysis-container,
    .trends-container,
    .settings-container,
    .faq-section {
        border: 2px solid #000;
    }
    
    .action-btn,
    .scan-btn,
    .lang-toggle,
    .refresh-btn {
        border: 2px solid #000;
    }
}
