﻿/* epicEFI Flasher - Modern Dark Mode UI Styling */

/* Dark Theme Base - Warm Gray */
body {
    background-color: #1a1a1a;
    color: #e4e4e7;
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #e4e4e7;
    margin: 0 0 10px 0;
    font-size: 2em;
}

/* Status Indicator */
#status {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.status-disconnected {
    background-color: #dc3545;
    color: white;
}

.status-connecting {
    background-color: #ffc107;
    color: #1a1a1a;
}

.status-ready {
    background-color: #28a745;
    color: white;
}

.status-working {
    background-color: #17a2b8;
    color: white;
}

.status-error {
    background-color: #dc3545;
    color: white;
}

/* Progress Section */
.progress-section {
    margin: 20px 0;
    text-align: center;
}

progress {
    width: 100%;
    height: 30px;
    border-radius: 5px;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background-color: #3f3f5a;
    border-radius: 5px;
}

progress::-webkit-progress-value {
    background-color: #2c8898;
    transition: width 0.3s ease;
}

#progressText {
    margin-top: 10px;
    color: #a1a1aa;
    font-size: 0.95em;
}

/* Button Group */
.button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

button {
    padding: 18px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#connectBtn {
    background: linear-gradient(135deg, #2c8898 0%, #1e6b7a 100%);
    color: white;
}

#connectBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #257a8a 0%, #1a5f6d 100%);
}

#connectBtn.connected {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

#backupBtn, #flashBtn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

#backupBtn:not(:disabled):hover {
    background: linear-gradient(135deg, #5a6268 0%, #4a5055 100%);
}

#flashBtn:not(:disabled):hover {
    background: linear-gradient(135deg, #5a6268 0%, #4a5055 100%);
}

#flashBtn.active {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

#exitDfuBtn {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

#exitDfuBtn:not(:disabled):hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

/* File Input Section */
.file-input-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 2px dashed #404040;
}

.file-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #e4e4e7;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #404040;
    border-radius: 5px;
    background-color: #1a1a1a;
    color: #e4e4e7;
    font-size: 1em;
    cursor: pointer;
}

input[type="file"]:disabled {
    background-color: #242424;
    cursor: not-allowed;
}

#fileInfo {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
    display: none;
}

#fileInfo.has-file {
    display: block;
    background-color: #1e4d2b;
    color: #4ade80;
    border: 1px solid #22c55e;
}

/* Activity Log */
.log-section {
    margin: 25px 0;
}

.log-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #e4e4e7;
}

#activityLog {
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    align-items: flex-start;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .timestamp {
    color: #71717a;
    margin-right: 10px;
    flex-shrink: 0;
}

.log-entry .message {
    flex: 1;
}

.log-entry.success .message {
    color: #4ade80;
    font-weight: 600;
}

.log-entry.error .message {
    color: #f87171;
    font-weight: 600;
}

.log-entry.warning .message {
    color: #fbbf24;
    font-weight: 600;
}

.log-entry.info .message {
    color: #38bdf8;
}

/* Recovery Instructions */
#recoveryInstructions {
    display: none;
    margin: 20px 0;
    padding: 20px;
    background-color: #423d0f;
    border: 1px solid #fbbf24;
    border-radius: 8px;
}

#recoveryInstructions.show {
    display: block;
}

#recoveryInstructions h4 {
    margin: 0 0 15px 0;
    color: #fbbf24;
}

#recoveryInstructions ol {
    margin: 0;
    padding-left: 20px;
}

#recoveryInstructions li {
    margin: 8px 0;
    color: #fef3c7;
}

#recoveryInstructions p {
    color: #fef3c7;
}

#recoveryInstructions strong {
    color: #fbbf24;
}

/* Help Section */
.help-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 8px;
}

.help-section details {
    cursor: pointer;
}

.help-section summary {
    font-weight: 600;
    color: #e4e4e7;
    font-size: 1.1em;
    list-style: none;
    display: flex;
    align-items: center;
}

.help-section summary::-webkit-details-marker {
    display: none;
}

.help-section summary::before {
    content: 'â–¶';
    margin-right: 10px;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.help-section details[open] summary::before {
    transform: rotate(90deg);
}

.help-content {
    margin-top: 15px;
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 5px;
}

.help-content h4 {
    margin: 0 0 10px 0;
    color: #e4e4e7;
}

.help-content ol {
    margin: 0;
    padding-left: 20px;
}

.help-content li {
    margin: 8px 0;
    line-height: 1.5;
    color: #a1a1aa;
}

.help-content p {
    color: #a1a1aa;
}

.help-content strong {
    color: #e4e4e7;
}

.help-content a {
    color: #38bdf8;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

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

    header h1 {
        font-size: 1.5em;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    button {
        padding: 15px 20px;
        font-size: 1em;
    }

    #status {
        font-size: 1em;
        padding: 15px;
    }
}

/* Custom Scrollbar for Dark Mode */
#activityLog::-webkit-scrollbar {
    width: 8px;
}

#activityLog::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

#activityLog::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

#activityLog::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}
