@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary-color: #0052CC;
    --secondary-color: #0065FF;
    --background-color: #FAFBFC;
    --surface-color: #FFFFFF;
    --text-primary: #172B4D;
    --text-secondary: #5E6C84;
    --border-color: #E6E8EC;
    --success-color: #36B37E;
    --warning-color: #FF991F;
    --error-color: #FF5630;
    --nav-bg: #0747A6;
    --nav-text: #DEEBFF;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.08);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Layout */
.container {
    display: flex;
    height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Common Styles */
.card, .scraper-item, .log-panel {
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card {
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Navigation */
.navigation {
    width: 300px;
    background-color: var(--nav-bg);
    position: relative;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background-image: url("/static/images/navbar-background.svg");
    mask-image: linear-gradient(to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.95) 15%,
    rgba(0, 0, 0, 0) 100%);
    opacity: 0.3; /* Daha subtle bir desen */
    pointer-events: none;
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.nav-logo {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.nav-header h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

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

.nav-item {
    padding: 10px 12px;
    border-radius: 3px;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    margin: 2px 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ffffff;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status-running {
    background-color: #E3FCEF;
    color: var(--success-color);
}

.status-pending {
    background-color: #FFFAE6;
    color: var(--warning-color);
}

.status-completed {
    background-color: #DEEBFF;
    color: var(--primary-color);
}

.status-critical {
    background-color: #FFEBE6;
    color: var(--error-color);
}

/* Forms & Controls */
.combobox {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-color) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23172B4D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding: 8px 32px 8px 12px;
    appearance: none;
    outline: none;
    transition: all 0.2s;
}

.combobox:hover {
    border-color: var(--text-secondary);
}

.combobox:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 101, 255, 0.12);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
}

.button-primary {
    align-items: center;
    justify-content: center;
    min-width: 100px;
    background-color: var(--primary-color);
    color: white;
}

.button-primary:hover {
    background-color: var(--secondary-color);
}

.button-secondary {
    justify-content: center;
    align-items: center;
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.button-secondary:hover {
    justify-content: center;
    border-color: var(--primary-color);
    background-color: #F8FAFC;
}

.button-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Log Panel */
.log-panel {
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.log-panel-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: #FAFBFC;
    border-radius: 8px 8px 0 0;
}

.log-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.log-select-group:first-child {
    flex: 2;
}

.log-select-group:not(:first-child) {
    width: 200px;
}

.log-select-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.log-content {
    flex: 1;
    position: relative;
    border-radius: 0 0 8px 8px;
    background-color: #FAFBFC;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-content-view {
    flex: 1;
    overflow: auto;
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.2;
    background-color: #FCFDFE;
    white-space: pre;
    font-variant-numeric: tabular-nums;
    -moz-font-feature-settings: "tnum";
    -webkit-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 108, 132, 0.2) transparent;
}

.log-line {
    display: flex;
    align-items: flex-start;
}

.log-line-number {
    color: #A1A8B3;
    user-select: none;
    font-size: 15px;
    opacity: 0.6;
    min-width: 45px;
    display: inline-block;
    width: 4ch;
    text-align: right;
    padding-right: 1ch;
}

/* Scroll Bar */
.log-content-view::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.log-content-view::-webkit-scrollbar-track {
    background: transparent;
}

.log-content-view::-webkit-scrollbar-thumb {
    background: rgba(94, 108, 132, 0.2);
    border-radius: 4px;
}

.log-content-view::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 108, 132, 0.3);
}

/* Log Syntax Highlighting */
.log-level {
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 2px;
    display: inline-block;
    width: 6ch;
    text-align: center;
    margin-right: 5px;
}

.log-level-INFO {
    color: #0747A6;
    background: #DEEBFF;
}

.log-level-ERROR {
    color: #DE350B;
    background: #FFEBE6;
}

.log-level-WARNING {
    color: #974F0C;
    background: #FFF7D6;
}

.log-level-CRITICAL {
    color: #BF2600;
    background: #FFEDEB;
}

.log-url {
    color: #0052CC;
    text-decoration: underline;
}

.log-timestamp {
    color: #6B7280;
    font-weight: 500;
    margin-right: 4px;
}

.log-success {
    color: #22863A;
}

.log-update {
    color: #6937A7;
}

.log-create {
    color: #1A7F37;
}

.log-count {
    color: #0550AE;
    font-weight: 500;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scraper List */
.scraper-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.scraper-item {
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.scraper-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.proxy-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0.8;
}

.scraper-item:hover .proxy-icon {
    opacity: 1;
}

/* Full Width Container */
.full-width-container {
    margin: -24px;
    padding: 24px;
    background-color: var(--surface-color);
    min-height: calc(100vh - 48px);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background-color: var(--surface-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

/* Auto-scroll container */
.auto-scroll {
    scroll-behavior: smooth;
}

.auto-scroll.user-scrolling {
    scroll-behavior: auto;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #fafbfc;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #fafbfc url("/static/images/navbar-background.svg");
    opacity: 0.2;
}

.login-box {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

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

.login-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--nav-bg);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon svg {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

.input-icon input:focus {
    border-color: var(--nav-bg);
    box-shadow: 0 0 0 3px rgba(7, 71, 166, 0.1);
    outline: none;
}

.input-icon input:focus + svg {
    color: var(--nav-bg);
}

.login-button {
    background: var(--nav-bg);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
}

.login-button:hover {
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(7, 71, 166, 0.2);
}

.login-button svg {
    transition: transform 0.2s;
}

.login-button:hover svg {
    color: white;
}

.login-error {
    color: var(--error-color);
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    padding: 8px;
    border-radius: 6px;
    background: #FFEBE6;
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.2s;
}

.login-error:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

.logout {
    margin-top: auto;
    color: #deebff;
}

/* External Control Styles */
.manuel-control {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 100px);
}

.control-panel {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: #FAFBFC;
    border-radius: 8px 8px 0 0;
}

.control-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.flex-grow {
    flex: 1;
}

.button-group {
    display: flex;
    gap: 8px;
}

.output-container {
    flex: 1;
    min-height: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.kill-all-button {
    background-color: var(--error-color);
    color: white;
    padding: 6px 10px;
}

.kill-all-button:hover {
    background-color: #DE350B;
}

.kill-all-button svg {
    margin-right: 4px;
    width: 13px;
    height: 13px;
}

.button-with-spinner {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-with-spinner i {
    margin-right: 4px;
}

.spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--nav-text);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

.button-loading .spinner {
    display: inline-block;
}

.button-loading {
    opacity: 0.8;
    cursor: not-allowed;
}

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

.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.dialog-content button {
    margin-top: 16px;
}

.proxy_test {
    justify-content: center;
    align-items: center;
}

.log-pagination {
    border-top: 1px solid var(--border-color);
    background-color: #FAFBFC;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 5px;
    padding: 0.5rem;
}

.next-run-item {
    font-size: 14px;
}

.next-run-item strong {
    color: var(--primary-color);
}
