/* Marktplaats-Notifications Stylesheet */
/* Color scheme based on Marktplaats logo */

:root {
    --mp-primary: #2D3C4D;
    --mp-primary-dark: #1E2A38;
    --mp-primary-light: #3D5268;
    --mp-accent: #EEA566;
    --mp-accent-dark: #D9904E;
    --mp-accent-light: #F4C08E;
    --mp-bg: #F0F2F5;
    --mp-white: #FFFFFF;
    --mp-gray-light: #E2E5EA;
    --mp-gray: #8C939D;
    --mp-gray-dark: #5A6270;
    --mp-text: #2D3C4D;
    --mp-text-light: #5A6270;
    --mp-success: #2E7D52;
    --mp-danger: #C0392B;
    --mp-warning: #E6A817;
    --sidebar-width: 250px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--mp-bg);
    color: var(--mp-text);
    min-height: 100vh;
    display: flex;
}

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

a:hover {
    color: var(--mp-accent-dark);
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--mp-primary);
    color: var(--mp-white);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sidebar-header .subtitle {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.07);
    color: var(--mp-white);
    text-decoration: none;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--mp-white);
    border-left-color: var(--mp-accent);
}

.sidebar-nav a .icon {
    margin-right: 12px;
    font-size: 17px;
    width: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    opacity: 0.4;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.page-header {
    background: var(--mp-white);
    padding: 20px 30px;
    border-bottom: 1px solid var(--mp-gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--mp-text);
}

.page-content {
    padding: 25px 30px;
}

/* Cards */
.card {
    background: var(--mp-white);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(45, 60, 77, 0.06), 0 1px 2px rgba(45, 60, 77, 0.04);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(45, 60, 77, 0.06);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--mp-gray-light);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--mp-text);
}

.card-header .header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(45, 60, 77, 0.07);
    color: var(--mp-primary);
    margin-right: 10px;
    font-size: 14px;
    flex-shrink: 0;
}

.card-header-left {
    display: flex;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--mp-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(45, 60, 77, 0.08);
    text-align: center;
    border: none;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(45, 60, 77, 0.12);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.stat-card .stat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mp-text);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-description {
    font-size: 12px;
    color: var(--mp-gray);
    margin-top: 6px;
}

/* Stat card color variants - high specificity to override defaults */
.stat-card .stat-icon.text-primary,
.stat-card .stat-value.text-primary { color: #2D3C4D; }

.stat-card .stat-icon.text-success,
.stat-card .stat-value.text-success { color: #2E7D52; }

.stat-card .stat-icon.text-warning,
.stat-card .stat-value.text-warning { color: #D9904E; }

.stat-card .stat-icon.text-info,
.stat-card .stat-value.text-info { color: #2196F3; }

/* Last Found Item stat card */
.stat-card.last-item-card {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.last-item-card .stat-icon {
    margin-bottom: 12px;
}

.last-item-card .stat-title {
    margin-bottom: 10px;
}

.last-item-preview {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.last-item-preview img {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--mp-bg);
    border: 1px solid var(--mp-gray-light);
}

.last-item-preview .no-img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: var(--mp-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-gray);
    font-size: 18px;
    flex-shrink: 0;
}

.last-item-info {
    text-align: left;
    min-width: 0;
    flex: 1;
}

.last-item-info .item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    margin-bottom: 2px;
}

.last-item-info .item-time {
    font-size: 11px;
    color: var(--mp-gray);
}

.last-item-info .item-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #2196F3;
    color: #2196F3;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.last-item-info .item-view-btn:hover {
    background: #2196F3;
    color: var(--mp-white);
    text-decoration: none;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.running {
    background: #E8F5ED;
    color: var(--mp-success);
}

.status-badge.stopped {
    background: #FDE8E5;
    color: var(--mp-danger);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.status-dot.green { background: var(--mp-success); }
.status-dot.red { background: var(--mp-danger); }

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--mp-bg);
    padding: 10px 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--mp-gray-dark);
    border-bottom: 2px solid var(--mp-gray-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--mp-gray-light);
    font-size: 14px;
}

table tr:hover {
    background: #F8F9FA;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--mp-text);
}

.form-group .help-text {
    font-size: 12px;
    color: var(--mp-gray);
    margin-top: 4px;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--mp-gray-light);
    border-radius: 6px;
    font-size: 14px;
    color: var(--mp-text);
    background: var(--mp-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px rgba(238, 165, 102, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: monospace;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45, 60, 77, 0.15);
}

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

.btn-primary:hover {
    background: var(--mp-accent-dark);
    color: var(--mp-white);
}

.btn-secondary {
    background: var(--mp-gray-light);
    color: var(--mp-text);
}

.btn-secondary:hover {
    background: #D1D5DB;
}

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

.btn-danger:hover {
    background: #A93226;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* Checkbox toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--mp-gray-light);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

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

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Flash messages */
.flash-messages {
    padding: 0 30px;
    margin-top: 15px;
}

.flash-message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-message.success {
    background: #E8F5ED;
    color: var(--mp-success);
    border-left: 4px solid var(--mp-success);
}

.flash-message.error {
    background: #FDE8E5;
    color: var(--mp-danger);
    border-left: 4px solid var(--mp-danger);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.item-card {
    background: var(--mp-white);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(45, 60, 77, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid rgba(45, 60, 77, 0.06);
}

.item-card:hover {
    box-shadow: 0 4px 15px rgba(45, 60, 77, 0.12);
    transform: translateY(-2px);
}

.item-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--mp-gray-light);
}

.item-card-body {
    padding: 12px 15px;
}

.item-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mp-text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-accent-dark);
    margin-bottom: 4px;
}

.item-card-meta {
    font-size: 12px;
    color: var(--mp-gray-dark);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.item-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 8px;
}

.item-card-meta .bi {
    font-size: 11px;
}

/* Log viewer */
.log-viewer {
    background: #1A2332;
    color: #D4D4D4;
    padding: 20px;
    border-radius: 8px;
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Query URL display */
.query-text {
    font-family: monospace;
    font-size: 13px;
    background: var(--mp-bg);
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--mp-gray);
}

.empty-state .icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--mp-gray-light);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2,
    .sidebar-header .subtitle,
    .sidebar-nav a span:not(.icon),
    .sidebar-footer {
        display: none;
    }
    .sidebar-nav a {
        justify-content: center;
        padding: 15px;
    }
    .sidebar-nav a .icon {
        margin-right: 0;
    }
    .main-content {
        margin-left: 60px;
    }
    .page-content {
        padding: 15px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .last-item-info .item-title {
        max-width: 100px;
    }
}

/* Inline form */
.inline-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.inline-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Action row */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Tag */
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: var(--mp-gray-light);
    color: var(--mp-gray-dark);
}

.tag.orange {
    background: rgba(238, 165, 102, 0.15);
    color: var(--mp-accent-dark);
}

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--mp-primary) 0%, var(--mp-primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--mp-white);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding: 40px 35px;
}

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

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--mp-text);
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: var(--mp-gray-dark);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

.login-flash-messages {
    margin-bottom: 20px;
}

.login-flash-messages .flash-message {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
}

/* Logout button in sidebar */
.sidebar-logout {
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout form {
    display: block;
}

.sidebar-logout button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-logout button:hover {
    color: var(--mp-accent-light);
}

.sidebar-logout button .icon {
    margin-right: 12px;
    font-size: 17px;
    width: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
