/**
 * AGTM Rapor - CSS Styles
 * Version: 1.0.1 - Yıllık Haftalık Personel Raporu + Personel Listesi
 */

/* CSS Variables */
:root {
    --agtm-primary-color: #2c5aa0;
    --agtm-primary-dark: #1e3c72;
    --agtm-success-color: #059669;
    --agtm-error-color: #dc2626;
    --agtm-warning-color: #d97706;
    --agtm-gray-50: #f8fafc;
    --agtm-gray-100: #f1f5f9;
    --agtm-gray-200: #e2e8f0;
    --agtm-gray-300: #cbd5e1;
    --agtm-gray-500: #64748b;
    --agtm-gray-900: #1e293b;
}

/* Main Container */
.agtm-container {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* Header */
.agtm-header {
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.2);
}

.agtm-header h2 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

.agtm-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.agtm-year-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.agtm-year-controls label {
    font-weight: 600;
    white-space: nowrap;
    font-size: 14px;
}

.agtm-year-controls select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    min-width: 120px;
}

.agtm-year-controls select option {
    background: var(--agtm-primary-color);
    color: white;
}

/* Buttons */
.agtm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.agtm-btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.agtm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    background: #2563eb;
}

.agtm-btn-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #5b21b6 100%) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3) !important;
}

.agtm-btn-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4) !important;
    background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%) !important;
}

.agtm-btn-excel {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3) !important;
}

.agtm-btn-excel:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.4) !important;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

.agtm-btn.agtm-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Tabs */
.agtm-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.agtm-tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--agtm-gray-500);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.agtm-tab-btn:hover {
    background: var(--agtm-gray-100);
    color: var(--agtm-gray-900);
}

.agtm-tab-btn.active {
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

/* Tab Content */
.agtm-tab-content {
    display: none;
    animation: agtmFadeIn 0.3s ease-in-out;
}

.agtm-tab-content.active {
    display: block;
}

/* Login Required */
.agtm-login-required {
    text-align: center;
    padding: 40px 20px;
}

.agtm-login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.agtm-login-box h3 {
    margin: 0 0 15px 0;
    color: var(--agtm-primary-color);
    font-size: 20px;
}

.agtm-login-box p {
    margin: 0;
    color: var(--agtm-gray-500);
    font-size: 14px;
}

/* Content */
.agtm-content {
    animation: agtmFadeIn 0.3s ease-in-out;
}

@keyframes agtmFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome State */
.agtm-welcome {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.agtm-welcome-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.agtm-welcome h3 {
    margin: 0 0 15px 0;
    color: var(--agtm-gray-900);
    font-size: 20px;
}

.agtm-welcome p {
    margin: 0;
    color: var(--agtm-gray-500);
    font-size: 14px;
}

/* Report Header */
.agtm-report-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.agtm-report-header h3 {
    margin: 0 0 10px 0;
    color: var(--agtm-gray-900);
    font-size: 20px;
    font-weight: 600;
}

.agtm-report-info {
    font-size: 14px;
    color: var(--agtm-gray-500);
    font-weight: 500;
}

/* Table Container */
.agtm-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    overflow-x: auto;
}

/* Main Table */
.agtm-report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
    min-width: 1200px;
}

/* Table Headers */
.agtm-report-table thead th {
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%);
    color: white;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.agtm-header-months th {
    padding: 12px 8px;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.agtm-header-weeks th {
    padding: 8px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 35px;
}

/* Sabit sütunlar - SADECE ay başlıkları satırı (agtm-header-months) için sticky */
.agtm-header-months th:nth-child(1),
.agtm-header-months th:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 15;
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%) !important;
    color: white !important;
}

.agtm-header-months th:nth-child(2) {
    left: 60px; /* Sıra no sütunun genişliği */
}

/* Hafta numaraları satırı - sticky değil, sadece renk */
.agtm-header-weeks th:nth-child(1),
.agtm-header-weeks th:nth-child(2) {
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%) !important;
    color: white !important;
    position: static !important; /* Sticky özelliğini iptal et */
}

.agtm-report-table td:nth-child(1),
.agtm-report-table td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 5;
}

.agtm-report-table td:nth-child(2) {
    left: 60px; /* Sıra no sütunun genişliği */
}

/* Table Body */
.agtm-employee-row {
    transition: background-color 0.2s ease;
}

.agtm-employee-row:nth-child(even) {
    background: var(--agtm-gray-50);
}

.agtm-employee-row:hover {
    background: #e0f2fe !important;
}

.agtm-employee-row td {
    padding: 8px 6px;
    border: 1px solid var(--agtm-gray-200);
    text-align: center;
    vertical-align: middle;
}

/* Özel sütun stilleri */
.agtm-row-number {
    width: 60px;
    min-width: 60px;
    font-weight: 600;
    background: var(--agtm-gray-100) !important;
    color: var(--agtm-gray-900) !important;
}

.agtm-employee-name {
    width: 200px;
    min-width: 200px;
    max-width: 250px;
    text-align: left !important;
    font-weight: 600;
    color: var(--agtm-gray-900) !important;
    background: var(--agtm-gray-100) !important;
    padding-left: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agtm-hours-cell {
    width: 35px;
    min-width: 35px;
    font-weight: 600;
    font-size: 10px;
}

.agtm-has-hours {
    background: #dcfce7 !important;
    color: #15803d;
}

.agtm-no-hours {
    background: #fef2f2 !important;
    color: var(--agtm-gray-400);
}

.agtm-before-start {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    opacity: 0.6;
    position: relative;
}

/* Employee List Table */
.agtm-employee-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.agtm-employee-list-table thead th {
    background: linear-gradient(135deg, var(--agtm-primary-color) 0%, var(--agtm-primary-dark) 100%);
    color: white;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 8px;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.agtm-employee-list-table tbody tr {
    transition: background-color 0.2s ease;
}

.agtm-employee-list-table tbody tr:nth-child(even) {
    background: var(--agtm-gray-50);
}

.agtm-employee-list-table tbody tr:hover {
    background: #e0f2fe !important;
}

.agtm-employee-list-table tbody td {
    padding: 10px 8px;
    border: 1px solid var(--agtm-gray-200);
    text-align: center;
    vertical-align: middle;
    font-size: 11px;
}

/* Aktif ve Pasif Personel Stilleri */
.agtm-active-employee {
    background: #f0fdf4 !important;
}

.agtm-active-employee:nth-child(even) {
    background: #dcfce7 !important;
}

.agtm-inactive-employee {
    background: #fef2f2 !important;
    opacity: 0.7;
}

.agtm-inactive-employee:nth-child(even) {
    background: #fee2e2 !important;
    opacity: 0.7;
}

/* Personel listesi özel sütunları */
.agtm-employee-list-table .agtm-row-number {
    width: 60px;
    min-width: 60px;
    font-weight: 600;
    background: var(--agtm-gray-100) !important;
    color: var(--agtm-gray-900) !important;
}

.agtm-employee-list-table .agtm-employee-name {
    text-align: left !important;
    font-weight: 600;
    color: var(--agtm-gray-900) !important;
    background: var(--agtm-gray-100) !important;
    padding-left: 12px !important;
    min-width: 200px;
}

.agtm-employee-list-table tbody td:nth-child(3) {
    text-align: left !important;
    font-weight: 600;
    padding-left: 12px !important;
    min-width: 200px;
}

.agtm-employee-list-table tbody td:nth-child(7),
.agtm-employee-list-table tbody td:nth-child(11) {
    text-align: left !important;
    padding-left: 8px !important;
    max-width: 200px;
    word-wrap: break-word;
}

/* Loading States */
.agtm-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--agtm-gray-500);
}

.agtm-loading p {
    margin: 10px 0 0 0;
    font-size: 14px;
}

.agtm-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--agtm-gray-200);
    border-top: 3px solid var(--agtm-primary-color);
    border-radius: 50%;
    animation: agtmSpin 1s linear infinite;
}

@keyframes agtmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.agtm-error {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.agtm-error h3 {
    margin: 0 0 15px 0;
    color: var(--agtm-error-color);
    font-size: 18px;
}

.agtm-error p {
    margin: 0;
    color: var(--agtm-gray-500);
    font-size: 14px;
}

/* Empty State */
.agtm-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.agtm-empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.agtm-empty-state h3 {
    margin: 0 0 15px 0;
    color: var(--agtm-gray-900);
    font-size: 18px;
}

.agtm-empty-state p {
    margin: 0;
    color: var(--agtm-gray-500);
    font-size: 14px;
}

/* Notifications */
.agtm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: agtmSlideInRight 0.3s ease-out;
    transition: opacity 0.3s ease;
}

.agtm-notification-success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.agtm-notification-error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.agtm-notification-info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e3a8a;
}

.agtm-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.agtm-notification-message {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
}

.agtm-notification-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 2px;
    border-radius: 3px;
}

.agtm-notification-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

@keyframes agtmSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .agtm-container {
        padding: 10px;
    }
    
    .agtm-table-container {
        margin: 0 -10px;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .agtm-header {
        padding: 15px 20px;
    }
    
    .agtm-header h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .agtm-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .agtm-year-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .agtm-year-controls select,
    .agtm-btn {
        width: 100%;
        min-width: auto;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .agtm-tabs {
        flex-direction: column;
        gap: 2px;
    }
    
    .agtm-tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .agtm-report-table,
    .agtm-employee-list-table {
        font-size: 9px;
    }
    
    .agtm-header-months th {
        padding: 8px 4px;
        font-size: 9px;
    }
    
    .agtm-header-weeks th {
        padding: 6px 3px;
        font-size: 8px;
        min-width: 25px;
    }
    
    .agtm-employee-row td,
    .agtm-employee-list-table tbody td {
        padding: 6px 3px;
        font-size: 9px;
    }
    
    .agtm-hours-cell {
        width: 25px;
        min-width: 25px;
        font-size: 8px;
    }
    
    .agtm-row-number {
        width: 40px;
    }
    
    .agtm-employee-name {
        width: 150px;
        font-size: 9px;
        padding-left: 8px !important;
    }
    
    /* Mobile'da sabit sütunlar */
    .agtm-report-table th:nth-child(2),
    .agtm-report-table td:nth-child(2) {
        left: 40px;
    }
    
    .agtm-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .agtm-header {
        padding: 12px 15px;
    }
    
    .agtm-header h2 {
        font-size: 16px;
    }
    
    .agtm-report-table,
    .agtm-employee-list-table {
        font-size: 8px;
    }
    
    .agtm-header-months th,
    .agtm-employee-list-table thead th {
        font-size: 8px;
        padding: 6px 2px;
    }
    
    .agtm-header-weeks th {
        font-size: 7px;
        padding: 4px 2px;
        min-width: 20px;
    }
    
    .agtm-hours-cell {
        width: 20px;
        min-width: 20px;
        font-size: 7px;
    }
    
    .agtm-row-number {
        width: 30px;
        font-size: 7px;
    }
    
    .agtm-employee-name {
        width: 120px;
        font-size: 8px;
    }
    
    .agtm-report-table th:nth-child(2),
    .agtm-report-table td:nth-child(2) {
        left: 30px;
    }
    
    .agtm-employee-list-table tbody td {
        padding: 4px 2px;
        font-size: 8px;
    }
}