:root {
    --bg-base: #0f1115;
    --bg-surface: #1a1d24;
    --bg-surface-hover: #22262f;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --border: #334155;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden; /* App takes full screen, scrolling is inside */
    width: 100vw;
    height: 100vh;
}

/* Glassmorphism utility */
.glass {
    background: rgba(26, 29, 36, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hidden {
    display: none !important;
}

/* --- Drag & Drop Zone --- */
.drop-zone {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-base);
    z-index: 100;
    transition: all 0.3s ease;
}

.drop-zone.active {
    display: flex;
}

.drop-zone.drag-over .drop-content {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
}

.drop-content {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    transition: all 0.3s ease;
    max-width: 500px;
}

.icon-container {
    color: var(--accent);
    margin-bottom: 24px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.main-title {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.2));
}

.drop-content .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.hidden-input {
    display: none;
}

.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.app-footer {
    position: absolute;
    bottom: 24px;
    width: 100%;
    text-align: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

/* --- Buttons --- */
.btn-primary, .btn-secondary, .btn-pro, .btn-close {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

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

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

.btn-pro {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-pro:hover {
    filter: brightness(1.1);
}

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

.btn-close:hover {
    background: var(--bg-surface-hover);
    color: white;
}

/* --- Viewer Interface --- */
.viewer-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Control Bar */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    height: 60px;
    z-index: 10;
}

.file-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.file-name {
    font-weight: 600;
    font-size: 16px;
}

.file-size {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.search-controls {
    display: flex;
    gap: 16px;
    flex: 1;
    max-width: 600px;
    margin: 0 24px;
}

.input-group {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px 8px 36px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}


.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Hide number input spin buttons */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type="number"] {
    -moz-appearance: textfield;
}

#goto-line-input {
    padding-right: 32px;
}

.icon-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--accent);
    background: var(--bg-surface-hover);
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: white;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar-container {
    height: 3px;
    width: 100%;
    background: var(--bg-base);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--accent-glow);
}

.progress-text {
    position: absolute;
    top: 8px;
    right: 24px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Scroller */
.scroller-viewport {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background-color: var(--bg-base);
}

.scroller-inner {
    position: relative;
    width: 100%;
    /* Height will be set via JS based on file size */
}

.lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    padding: 0 24px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-line {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding: 2px 0;
    display: flex;
}

.line-number {
    color: var(--border);
    min-width: 60px;
    user-select: none;
    text-align: right;
    padding-right: 16px;
}

.line-content {
    flex: 1;
}

.highlight {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-radius: 2px;
    padding: 0 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 8px;
    border: 3px solid var(--bg-surface);
}

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

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

/* --- Modals --- */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-close-modal:hover {
    color: white;
    text-decoration: underline;
}

.license-input-container {
    margin-top: 24px;
    display: flex;
    gap: 8px;
    animation: fadeIn 0.2s ease;
}

/* --- Responsive Adjustments (Mobile Landscape & Small Screens) --- */
@media (max-height: 600px), (max-width: 600px) {
    .drop-zone {
        justify-content: flex-start;
        padding: 40px 20px;
        overflow-y: auto;
    }
    
    .main-title {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .drop-content {
        padding: 24px;
        width: 100%;
        max-width: 100%;
    }
    
    .icon-container {
        margin-bottom: 16px;
    }
    
    .icon-container svg {
        width: 48px;
        height: 48px;
    }
    
    .app-footer {
        position: relative;
        bottom: auto;
        margin-top: 32px;
    }
}
