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

:root {
    --bg-primary: #0a0813;
    --bg-secondary: #121021;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-hover: rgba(255, 255, 255, 0.08);
    
    --accent: #6c5ce7;
    --accent-hover: #5b4cd8;
    --accent-glow: rgba(108, 92, 231, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a29bfe;
    --text-muted: #747d8c;
    
    --income: #00cec9;
    --income-glow: rgba(0, 206, 201, 0.2);
    --expense: #ff7675;
    --expense-glow: rgba(255, 118, 117, 0.2);
    
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #0984e3;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Page Layout */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at top right, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.6s ease;
}

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

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 10;
    transition: var(--transition);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--income) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item {
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-link:hover, .sidebar-item.active .sidebar-link {
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.sidebar-item.active .sidebar-link {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: #fff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--card-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--border-radius);
    background: rgba(0,0,0,0.2);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    flex-grow: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--expense);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--expense-glow);
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 9;
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

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

.main-content {
    padding: 32px;
    flex-grow: 1;
    animation: fadeIn 0.4s ease;
}

/* Components & Common Classes */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255,255,255,0.12);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select.form-control option {
    background-color: var(--bg-secondary);
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #bd2130;
    box-shadow: 0 0 12px rgba(214, 48, 49, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Dashboard Summary Cards */
.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.stat-card.income::before { background: var(--income); }
.stat-card.expense::before { background: var(--expense); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-secondary);
}

.stat-card.income .stat-icon { color: var(--income); background: var(--income-glow); }
.stat-card.expense .stat-icon { color: var(--expense); background: var(--expense-glow); }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 16px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-yeni { background: var(--info); color: #fff; }
.badge-arandı { background: var(--warning); color: #000; }
.badge-ilgileniyor { background: var(--accent); color: #fff; }
.badge-müşteri { background: var(--success); color: #fff; }
.badge-kaybedildi { background: var(--danger); color: #fff; }

.badge-ödendi { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.badge-bekliyor { background: rgba(241, 196, 15, 0.15); color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.3); }
.badge-kısmi { background: rgba(9, 132, 227, 0.15); color: #0984e3; border: 1px solid rgba(9, 132, 227, 0.3); }

.badge-düşük { background: rgba(255,255,255,0.05); color: #fff; }
.badge-normal { background: var(--info); color: #fff; }
.badge-yüksek { background: var(--warning); color: #000; }
.badge-acil { background: var(--danger); color: #fff; }

/* Filter Container */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.15);
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

/* Kanban Board for Services/Tasks */
.kanban-board {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

.kanban-column-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kanban-column-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-cards {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-height: 100px;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    cursor: grab;
    transition: var(--transition);
}

.kanban-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.kanban-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.kanban-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kanban-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Customer Details Layout */
.detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 7px;
    bottom: 0;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 4px;
    left: -21px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-secondary);
}

.timeline-item.arama::before { background: var(--warning); }
.timeline-item.mesaj::before { background: var(--success); }
.timeline-item.not::before { background: var(--text-muted); }

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
}

.timeline-user {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Call Queue layout */
.queue-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--card-border);
}

.queue-card:last-child {
    border-bottom: none;
}

.queue-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px 24px;
    color: #fff;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* Common Stream Activity Items */
.activity-stream {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.01);
}

.activity-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
}

.activity-details {
    flex-grow: 1;
    font-size: 0.85rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .detail-layout {
        grid-template-columns: 1fr;
    }
}
