/* ========== AdChanger - Light Blue Google Play Theme ========== */

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

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --primary-hover: #185abc;
    --secondary: #5f6368;
    --bg: #f5f9ff;
    --bg-card: #ffffff;
    --border: #dadce0;
    --border-light: #e8eaed;
    --text: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --success: #0f9d58;
    --warning: #f9ab00;
    --error: #d93025;
    --shadow-sm: 0 1px 2px rgba(60,64,67,0.1);
    --shadow: 0 1px 3px rgba(60,64,67,0.15), 0 1px 2px rgba(60,64,67,0.1);
    --shadow-lg: 0 4px 12px rgba(60,64,67,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
}

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

/* ========== MAIN ========== */
.main {
    flex: 1;
    padding: 32px 0;
}

/* ========== STEPS ========== */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

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

/* ========== CARD ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.success-card {
    text-align: center;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* ========== UPLOAD AREA ========== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--primary-light);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: #d6e4fe;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text strong {
    display: block;
    font-size: 18px;
    color: var(--text);
    margin-bottom: 4px;
}

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

.upload-hint {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.file-icon {
    font-size: 32px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--text);
}

.file-size {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
    width: 100%;
    margin-top: 16px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-icon:hover {
    background: var(--border-light);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== INFO BOX ========== */
.info-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 12px;
}

.info-box ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

.info-box li {
    margin: 6px 0;
    font-size: 14px;
}

.info-box code {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

code {
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

/* ========== PROGRESS ========== */
.progress-container {
    margin-top: 24px;
}

.progress-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #4285f4);
    transition: width 0.3s;
    border-radius: 4px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
}

#progressPercent {
    font-weight: 500;
    color: var(--primary);
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    background: transparent;
    border: none;
    font-size: 14px;
    font-family: inherit;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover:not(.active) {
    color: var(--text);
    background: var(--primary-light);
}

.tab-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 600;
}

.tab:not(.active) .tab-badge {
    background: var(--text-muted);
}

/* ========== TAB CONTENT ========== */
.tab-pane {
    display: none;
}

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

/* ========== BULK REPLACE ========== */
.bulk-replace {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.bulk-replace-title {
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.bulk-replace-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-replace-old {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    background: white;
    color: var(--text-secondary);
}

.bulk-replace-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}

.bulk-replace-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

/* ========== DETECTION CARDS ========== */
.detection-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.detection-card:hover {
    box-shadow: var(--shadow);
}

.detection-card.is-test {
    border-left: 4px solid var(--warning);
}

.detection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.detection-type {
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.detection-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.detection-badge.test {
    background: #fef7e0;
    color: #b06000;
}

.detection-old {
    background: var(--border-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
    word-break: break-all;
}

.detection-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    margin-top: 4px;
}

.detection-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.detection-input.invalid {
    border-color: var(--error);
}

.detection-input.valid {
    border-color: var(--success);
}

.detection-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========== WARNINGS / ERRORS ========== */
.warning-box {
    background: #fef7e0;
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    color: #b06000;
}

.error-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--error);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    z-index: 1000;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateX(400px); }
    to { transform: translateX(0); }
}

.error-icon {
    font-size: 20px;
}

.error-box .btn-icon {
    color: white;
    margin-left: auto;
}

/* ========== ACTIONS ========== */
.actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: 150px;
    margin-top: 0;
}

/* ========== HELPERS ========== */
.hidden {
    display: none !important;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    padding: 20px 0;
    margin-top: 32px;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .card {
        padding: 20px;
    }
    .card-title {
        font-size: 20px;
    }
    .header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-tag {
        font-size: 12px;
    }
    .upload-area {
        padding: 32px 16px;
    }
    .actions {
        flex-direction: column;
    }
    .actions .btn {
        width: 100%;
    }
}
