/**
 * Company/Şirket Tarafı CSS
 * Şirket kullanıcıları için özel stiller
 */

/* ========================================
   1. GENEL STILLER
   ======================================== */

:root {
    --company-primary: #667eea;
    --company-secondary: #764ba2;
    --company-gradient: linear-gradient(135deg, var(--company-primary) 0%, var(--company-secondary) 100%);
    --sidebar-width: 308px;
    --header-height: 60px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
}

/* Dashboard hover effects */
.hover-shadow:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.hover-shadow {
    transition: all 0.2s ease;
}

/* ========================================
   2. SIDEBAR
   ======================================== */

.sidebar {
    height: 100vh;
    background: var(--company-gradient);
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    direction: rtl;
    /* Klavye ile focus yapılabilir hale getir */
    tabindex: 0;
}

.sidebar:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

.sidebar .position-sticky {
    direction: ltr;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    padding: 0.5rem 1.25rem;
    margin: 0.15rem 1rem;
    border-radius: 8px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

/* Menu Groups */
.menu-group {
    margin-bottom: 0.75rem;
}

.menu-group-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 1.5rem;
    margin-bottom: 0.1rem;
}

.menu-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1.5rem;
}

/* Sidebar Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   3. MAIN CONTENT
   ======================================== */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 1rem 2rem;
    min-height: 100vh;
    background-color: #f8f9fa;
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
    position: relative;
}

.page-header {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.page-title {
    margin: 0;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

/* ========================================
   4. CARDS
   ======================================== */

.card {
    background: white;
    border: 1px solid #e3e6f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e3e6f0;
    padding: 1.25rem;
    font-weight: 600;
}

.stats-card {
    background: var(--company-gradient);
    color: white;
    padding: 1.5rem;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card .stats-label {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* ========================================
   5. FORMS
   ======================================== */

.form-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--company-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-check-input:checked {
    background-color: var(--company-primary);
    border-color: var(--company-primary);
}

/* ========================================
   6. BUTTONS
   ======================================== */

.btn-primary {
    background: var(--company-gradient);
    border: none;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    color: var(--company-primary);
    border-color: var(--company-primary);
}

.btn-outline-primary:hover {
    background: var(--company-gradient);
    border-color: transparent;
}

/* ========================================
   7. TABLES
   ======================================== */

.table {
    background: white;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #718096;
}

.table-hover tbody tr:hover {
    background-color: #f7fafc;
}

/* ========================================
   8. BADGES & ALERTS
   ======================================== */

.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-info {
    background: #ebf8ff;
    color: #2b6cb0;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
}

.alert-warning {
    background: #fefce8;
    color: #a16207;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* ========================================
   9. ASSISTANT SPECIFIC
   ======================================== */

.assistant-header {
    background: var(--company-gradient);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.function-card {
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.function-card:hover {
    border-color: var(--company-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.function-card.selected {
    background: #f0f4ff;
    border-color: var(--company-primary);
}

.persona-card {
    border: 2px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.persona-card:hover {
    border-color: var(--company-primary);
    transform: translateY(-2px);
}

.persona-card.selected {
    border-color: var(--company-primary);
    background: #f0f4ff;
}

.persona-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* ========================================
   10. TABS
   ======================================== */

.nav-tabs {
    border-bottom: 2px solid #e3e6f0;
}

.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: #e3e6f0;
    color: #4a5568;
}

.nav-tabs .nav-link.active {
    color: var(--company-primary);
    background: none;
    border-bottom-color: var(--company-primary);
}

/* ========================================
   11. MODALS & TOASTS
   ======================================== */

.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #e3e6f0;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e3e6f0;
    padding: 1.25rem;
}

/* Toast container */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

/* ========================================
   12. RESPONSIVE
   ======================================== */

/* Tablet ve küçük ekranlar */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem 1.5rem;
    }

    .page-header {
        margin-left: 0 !important;
        width: 100%;
    }

    .mobile-menu-toggle {
        display: inline-block !important;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobil cihazlar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 85% !important;
        max-width: 320px;
        height: 100vh;
        z-index: 1050;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem;
    }

    .page-header {
        margin-left: 0 !important;
        width: 100%;
        padding: 1rem;
        border-radius: 0;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .mobile-menu-toggle {
        display: inline-block !important;
        padding: 0.25rem 0.5rem;
        border: none;
        background: transparent;
    }

    .mobile-menu-toggle:hover {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 0.25rem;
    }

    /* Responsive tables */
    .table-responsive {
        font-size: 0.875rem;
    }

    /* Cards on mobile */
    .card {
        border-radius: 0.375rem;
        margin-bottom: 1rem;
    }

    /* Buttons on mobile */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Büyük ekranlar */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .sidebar {
        transform: translateX(0) !important;
        position: fixed;
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 576px) {
    .page-header {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    /* Stack buttons on mobile */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ========================================
   13. UTILITIES
   ======================================== */

.text-gradient {
    background: var(--company-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: var(--company-gradient);
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-progress {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in;
}

/* ========================================
   14. LAYOUT OVERRIDES (from admin.php)
   ======================================== */

/* Header Overrides */
.header {
    background: white;
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-info {
    text-align: right;
}

.header-user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

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

.header-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--company-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Content Area Override */
.content {
    padding: 2rem;
}

/* Modern Card */
.modern-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.modern-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.modern-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modern-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* ========================================
   15. TOAST NOTIFICATIONS (from admin.php)
   ======================================== */

#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    max-width: 350px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    overflow: hidden;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-notification-content {
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
}

.toast-notification-icon {
    font-size: 20px;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.toast-notification-danger .toast-notification-icon {
    color: #dc3545;
}

.toast-notification-success .toast-notification-icon {
    color: #198754;
}

.toast-notification-warning .toast-notification-icon {
    color: #ffc107;
}

.toast-notification-info .toast-notification-icon {
    color: #0dcaf0;
}

.toast-notification-body {
    flex: 1;
}

.toast-notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.2;
    color: #212529;
}

.toast-notification-message {
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

.toast-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-notification-close:hover {
    opacity: 1;
}

/* Progress bar for toast */
.toast-notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, transparent, currentColor);
    animation: toast-progress 5s linear;
}

.toast-notification-success::after {
    color: #198754;
}

.toast-notification-danger::after {
    color: #dc3545;
}

.toast-notification-warning::after {
    color: #ffc107;
}

.toast-notification-info::after {
    color: #0dcaf0;
}

/* ========================================
   16. MODERN MODALS (from admin.php)
   ======================================== */

.modern-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.modern-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s;
}

.modern-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modern-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.modern-modal-body {
    padding: 1.5rem;
}

.modern-modal-message {
    color: #495057;
    line-height: 1.6;
}

.modern-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modern-modal-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.modern-modal-btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.modern-modal-btn-cancel:hover {
    background: #dee2e6;
}

.modern-modal-btn-danger {
    background: #dc3545;
    color: white;
}

.modern-modal-btn-danger:hover {
    background: #c82333;
}

/* Function permission cards */
.function-permission-card {
    transition: all 0.3s ease;
    border: 1px solid #e3e6f0;
}

.function-permission-card:hover {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* Toggle switches for function permissions */
.form-check-input[role="switch"] {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-check-input[role="switch"]:checked {
    background-color: var(--company-primary);
    border-color: var(--company-primary);
}

.form-check-input[role="switch"]:focus {
    border-color: var(--company-primary);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}