/* style.css */
:root {
    --primary-color: #0F172A; /* Slate 900 - Navy */
    --primary-hover: #1E293B;
    --secondary-color: #3B82F6; /* Blue 500 */
    --secondary-hover: #2563EB;
    --bg-color: #F8FAFC; /* Slate 50 */
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    
    /* Status Colors */
    --status-yeni-bg: #DBEAFE;
    --status-yeni-text: #1D4ED8;
    --status-gorusuldu-bg: #FEF3C7;
    --status-gorusuldu-text: #B45309;
    --status-ilgileniyor-bg: #E0E7FF;
    --status-ilgileniyor-text: #4338CA;
    --status-ilgisiz-bg: #FEE2E2;
    --status-ilgisiz-text: #B91C1C;
    --status-satis-bg: #D1FAE5;
    --status-satis-text: #047857;

    --font-family: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Shared View Container */
.view-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Login Screen --- */
#login-view {
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
}
.login-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}
.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-primary:hover {
    background-color: var(--secondary-hover);
}
.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-secondary:hover {
    background-color: #F1F5F9;
    color: var(--text-main);
}
.error-msg {
    color: var(--status-ilgisiz-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* --- Dashboard --- */
.topbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.topbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
}
.topbar .btn-secondary {
    border-color: rgba(255,255,255,0.2);
    color: white;
}
.topbar .btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Stats Row */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    user-select: none;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 1px var(--secondary-color);
}
.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Action Bar (Search & Filter label) */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-family);
}
.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.active-filter-indicator {
    font-size: 0.875rem;
    color: var(--text-muted);
}
#current-filter-label {
    font-weight: 600;
    color: var(--text-main);
}

/* Leads List */
.leads-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.lead-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.lead-info {
    flex: 1;
}
.lead-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lead-platform {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: #F1F5F9;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.lead-phone {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.lead-date {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.25rem;
}

.lead-actions {
    display: flex;
    align-items: center;
}
.status-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 2rem;
    border: 1px solid var(--border-color);
    appearance: none;
    background-color: var(--card-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
}
.status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Status colors in select */
.status-select[data-status="Yeni"] { background-color: var(--status-yeni-bg); color: var(--status-yeni-text); border-color: var(--status-yeni-bg); }
.status-select[data-status="Görüşüldü"] { background-color: var(--status-gorusuldu-bg); color: var(--status-gorusuldu-text); border-color: var(--status-gorusuldu-bg); }
.status-select[data-status="İlgileniyor"] { background-color: var(--status-ilgileniyor-bg); color: var(--status-ilgileniyor-text); border-color: var(--status-ilgileniyor-bg); }
.status-select[data-status="İlgisiz"] { background-color: var(--status-ilgisiz-bg); color: var(--status-ilgisiz-text); border-color: var(--status-ilgisiz-bg); }
.status-select[data-status="Satış"] { background-color: var(--status-satis-bg); color: var(--status-satis-text); border-color: var(--status-satis-bg); }

.lead-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dynamic-answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.qa-item {
    background: #F8FAFC;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.qa-question {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}
.qa-answer {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
    word-break: break-word;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1rem;
    }
    .topbar {
        padding: 1rem;
    }
    .lead-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .status-select {
        width: 100%;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Panel Specific */
.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}
.admin-panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.users-list-container {
    overflow-x: auto;
}
.users-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.users-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.users-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.875rem;
}
.users-table tr:last-child td {
    border-bottom: none;
}
.users-table tbody tr:hover {
    background-color: #F8FAFC;
}

