/* --- CSS VARIABLES FOR THEME --- */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --navbar-bg: #343a40;
    --footer-bg: #000000;
    --border-color: #dee2e6;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e9ecef;
    --card-bg: #2d2d2d;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --navbar-bg: #000000;
    --footer-bg: #000000;
    --border-color: #495057;
}

/* --- SAYFA YAPISI VE STICKY FOOTER --- */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- KRİTİK GÜNCELLEME BURADA --- */
body>.container {
    width: 100%;
    /* İçerik bittiğinde Footer ile arasına 3rem (yaklaşık 50px) boşluk bırak */
    padding-bottom: 3rem !important;
}

/* --- DARK MODE SPECIFIC STYLES --- */
[data-theme="dark"] .card {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .table {
    color: var(--text-color);
    --bs-table-bg: #2d2d2d;
    --bs-table-striped-bg: #3a3a3a;
    --bs-table-striped-color: #e9ecef;
    --bs-table-hover-bg: #454545;
    --bs-table-hover-color: #ffffff;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: #3a3a3a;
    color: #e9ecef;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(even)>* {
    background-color: #2d2d2d;
    color: #e9ecef;
}

[data-theme="dark"] .table-hover>tbody>tr:hover>* {
    background-color: #454545 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .table-dark {
    --bs-table-bg: #1a1a1a;
    --bs-table-striped-bg: #252525;
    --bs-table-color: #e9ecef;
    --bs-table-border-color: #495057;
}

[data-theme="dark"] .table>thead {
    color: #e9ecef;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #3a3a3a;
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #3a3a3a;
    color: var(--text-color);
    border-color: #80bdff;
}

[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .accordion-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .accordion-button {
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #3a3a3a;
    color: var(--text-color);
}

/* --- NAVBAR THEME TOGGLE BUTTON --- */
#navbarThemeToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 38px;
    font-size: 18px;
    transition: all 0.3s ease;
    border: none !important;
    box-shadow: none !important;
}

#navbarThemeToggle:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
}

#navbarThemeToggle:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* --- FOOTER STİLLERİ --- */
.footer {
    margin-top: auto;
    width: 100%;
    background-color: var(--footer-bg) !important;
    color: #ffffff !important;
    padding: 1.5rem 0;
    flex-shrink: 0;
    border-top: 1px solid #333;
}

.footer .text-muted {
    color: #ffffff !important;
}

.footer small {
    color: #cccccc !important;
}

/* --- DİĞER STİLLER (Aynen Kalıyor) --- */
.card {
    border: none;
    box-shadow: 0 4px 8px var(--card-shadow);
    background-color: var(--card-bg);
    transition: background-color 0.3s ease;
}

.card-header {
    background-color: #343a40;
    color: white;
    font-weight: bold;
}

.btn {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link.active {
    font-weight: bold;
    color: #ffffff;
}

.table tfoot {
    font-weight: bold;
}

.list-group-item .badge {
    font-size: 0.9rem;
}

/* Kur Bilgisi Çubuğu */
.currency-bar {
    background-color: var(--navbar-bg);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.currency-bar .container {
    /* Buradaki container genel container ayarından (padding-bottom) etkilenmemeli */
    padding-bottom: 0 !important;
}

.currency-info,
.datetime-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .currency-bar {
        font-size: 0.85rem;
    }

    .currency-bar .d-flex {
        justify-content: center !important;
        text-align: center;
    }
}

.live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

/* --- MOBILE SIDEBAR STYLES --- */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--card-bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: var(--navbar-bg);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.sidebar-header svg {
    flex-shrink: 0;
}

.sidebar-header span {
    flex: 1;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.sidebar-close:hover {
    transform: rotate(90deg);
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

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

.user-name {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.85rem;
    color: #6c757d;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
}

.sidebar-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.sidebar-link.active {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
    font-weight: 600;
    border-left: 4px solid #007bff;
}

.sidebar-link span:first-child {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-link.logout-link {
    color: #dc3545;
}

.sidebar-link.logout-link:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 0;
}

.navbar-toggler-mobile {
    border: none;
    padding: 0.25rem 0.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.navbar-toggler-mobile:hover,
.navbar-toggler-mobile:focus {
    color: white;
    text-decoration: none;
}

.navbar-toggler-mobile .navbar-toggler-icon {
    width: 1.5em;
    height: 1.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hide sidebar on desktop */
@media (min-width: 992px) {

    .mobile-sidebar,
    .sidebar-overlay,
    .navbar-toggler-mobile {
        display: none !important;
    }
}

/* Dark mode adjustments for sidebar */
[data-theme="dark"] .sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #66b3ff;
}

[data-theme="dark"] .sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #66b3ff;
    border-left-color: #66b3ff;
}

[data-theme="dark"] .user-role {
    color: #adb5bd;
}

/* --- PROFILE PHOTO STYLES --- */
.user-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    margin: 0 auto;
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.navbar-user-avatar-text {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-photo-preview img {
    border: 3px solid #dee2e6;
}

[data-theme="dark"] .profile-photo-preview img {
    border-color: #495057;
}

/* --- DASHBOARD STYLES --- */
.dashboard-work-status {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-work-status .card-body {
    padding: 2rem;
}

.dashboard-work-status h5,
.dashboard-work-status h2,
.dashboard-work-status p {
    color: var(--text-color);
}

.timer-display {
    font-size: 1.75rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--text-color);
}

.stats-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stats-card .card-body {
    padding: 1.5rem;
    text-align: center;
}

.stats-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stats-label {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stats-value {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.stats-earnings {
    font-size: 1.25rem;
    font-weight: 600;
    color: #28a745;
}

.stats-today {
    border-left: 4px solid #007bff;
}

.stats-week {
    border-left: 4px solid #17a2b8;
}

.stats-month {
    border-left: 4px solid #ffc107;
}

.stats-year {
    border-left: 4px solid #28a745;
}

/* Dark mode adjustments for dashboard */
[data-theme="dark"] .dashboard-work-status {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stats-card {
    background-color: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stats-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .stats-label {
    color: #adb5bd;
}

[data-theme="dark"] .stats-earnings {
    color: #4ade80;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timer-display {
        font-size: 1.5rem;
    }

    .stats-icon {
        font-size: 2rem;
    }

    .stats-value {
        font-size: 1.5rem;
    }

    .stats-earnings {
        font-size: 1rem;
    }

    .dashboard-work-status .card-body {
        padding: 1.5rem;
    }
}