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

:root {
    --primary-dark: #0a1929;
    --primary-darker: #061222;
    --primary-blue: #1976d2;
    --primary-blue-dark: #115293;
    --primary-blue-light: #4791db;
    --accent-cyan: #00b4d8;
    --accent-purple: #7b2cbf;
    --text-primary: #e3f2fd;
    --text-secondary: #90caf9;
    --text-muted: #64b5f6;
    --bg-card: #132f4c;
    --bg-card-dark: #0a1e35;
    --border-color: #1e4976;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #1976d2 0%, #00b4d8 100%);
}

[data-theme="light"] {
    --primary-dark: #f8f9fa;
    --primary-darker: #e9ecef;
    --primary-blue: #1976d2;
    --text-primary: #1a237e;
    --text-secondary: #283593;
    --text-muted: #5c6bc0;
    --bg-card: #ffffff;
    --bg-card-dark: #f8f9fa;
    --border-color: #e0e0e0;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-cyan); }
    50% { box-shadow: 0 0 40px var(--accent-cyan); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* Base Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, #000 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-blue) 0%, transparent 70%);
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 500px;
    height: 500px;
    top: 50%;
    right: 10%;
    animation-delay: 5s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    animation: slideIn 0.8s ease-out;
}

/* Header */
.header {
    background: rgba(10, 25, 41, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-cyan);
    animation: glow 3s infinite;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pro-badge {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 8px;
    -webkit-text-fill-color: white;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #66bb6a);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--accent-cyan);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Sections */
.upload-section, .results-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header i {
    font-size: 3rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-muted);
}

.result-stats {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--bg-card-dark);
    border-radius: 8px;
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--accent-cyan);
    transform: scale(1.02);
}

.upload-area.active {
    border-color: var(--accent-cyan);
    background: rgba(25, 118, 210, 0.1);
}

.upload-icon {
    font-size: 4rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.feature-tag {
    background: var(--bg-card-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-progress {
    margin-top: 1rem;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-card-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.file-input {
    display: none;
}

/* File Info Card */
.file-info-card {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.file-info-card.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.file-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.file-info-header h4 {
    color: var(--text-primary);
    flex: 1;
}

.file-info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.file-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.file-detail:last-child {
    border-bottom: none;
}

.file-detail span:first-child {
    color: var(--text-muted);
}

.file-detail span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.file-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Quick Tools */
.quick-tools {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.quick-tools h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.tool-btn:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
}

/* Tabs */
.tabs-container {
    background: var(--bg-card-dark);
    border-radius: 16px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: var(--primary-darker);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-weight: 600;
}

.tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-cyan);
    border-bottom: 2px solid var(--accent-cyan);
}

.tabs-content {
    padding: 0;
}

.tab-pane {
    display: none;
    animation: slideIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card-dark);
}

.pane-header h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-container {
    max-height: 500px;
    overflow: auto;
}

.code-content {
    padding: 1.5rem;
    background: #1a1a1a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 0 0 16px 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.hex-view {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Analysis */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.analysis-card h5 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.info-item span:first-child {
    color: var(--text-muted);
}

.info-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--error);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

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

.loading-details {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.loading-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.loading-step.active {
    color: var(--accent-cyan);
}

.loading-step i {
    font-size: 1.2rem;
}

/* About Content */
.about-content {
    text-align: center;
}

.app-icon {
    font-size: 4rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--bg-card-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.feature-item i {
    color: var(--accent-cyan);
    font-size: 1.2rem;
    width: 20px;
}

.feature-item div {
    flex: 1;
}

.feature-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.feature-item span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

.setting-item label {
    color: var(--text-primary);
    flex: 1;
}

.setting-item select, .setting-item input[type="text"] {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    min-width: 150px;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

/* Source Actions */
.source-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Footer */
.footer {
    background: var(--primary-darker);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-section p {
    color: var(--text-muted);
    margin-bottom: 5px;
}

.footer-version {
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

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

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-actions {
        justify-content: center;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .file-actions, .quick-actions, .tool-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .tabs-header {
        flex-direction: column;
    }

    .tab-btn {
        min-width: auto;
    }

    .pane-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .file-info-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .upload-features {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .upload-section, .results-section {
        padding: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Selection */
::selection {
    background: var(--primary-blue);
    color: white;
}

/* Focus Outline */
button:focus, select:focus, input:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header, .footer, .file-actions, .quick-actions, .tabs-header {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .code-content {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc;
    }
}
