/* ========================================
 * Otomasyon Web - Paylaşılan Tasarım Sistemi
 * tasarim-rehberi.md referans alınarak oluşturulmuştur
 * ======================================== */

/* ========================================
 * 1. CSS Değişkenleri (Renk Paleti)
 * ======================================== */
:root {
    /* Ana Renkler */
    --gl-purple: #292961;
    --gl-purple-light: #6b4fbb;
    --gl-orange: #fc6d26;
    --gl-orange-hover: #e24329;

    /* Buton / Link */
    --gl-blue: #1f75cb;
    --gl-green: #108548;
    --gl-red: #dd2b0e;

    /* Nötr Tonlar */
    --gl-dark: #1f1f1f;
    --gl-gray-900: #303030;
    --gl-gray-700: #525252;
    --gl-gray-400: #868686;
    --gl-gray-100: #dbdbdb;
    --gl-gray-50: #f0f0f0;
    --gl-white: #ffffff;

    /* Layout */
    --sidebar-width: 220px;
}

/* ========================================
 * 2. Tipografi
 * ======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans',
                 Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--gl-gray-900);
    background-color: var(--gl-gray-50);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* ========================================
 * 3. Sayfa Yapısı (Layout)
 * ======================================== */
.layout {
    display: flex;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gl-purple);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    background: var(--gl-gray-50);
    min-height: 100vh;
}

/* ========================================
 * 4. Sidebar & Navigasyon
 * ======================================== */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.sidebar-brand .logo {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #fc6d26, #e24329);
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-brand span {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.bildirim-wrapper {
    position: relative;
}

.bildirim-ikon {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    text-decoration: none;
    position: relative;
}

.bildirim-ikon:hover {
    color: white;
}

.bildirim-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--gl-red);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 8px 0;
    flex: 1;
}

.nav-item {
    display: block;
    padding: 10px 16px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-left-color: var(--gl-orange);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 14px;
}

/* Nav Group (Submenu) */
.nav-group-label {
    display: block;
    padding: 12px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
}

.nav-group-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-group-toggle .fa-chevron-right {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-group.open .nav-group-toggle .fa-chevron-right {
    transform: rotate(90deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.15);
}

.nav-submenu .nav-item {
    padding-left: 42px;
    font-size: 12px;
}

.nav-group.open .nav-submenu {
    max-height: 2000px;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 8px 0;
}

.sidebar-footer .user-info {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    padding: 12px 16px;
}

.sidebar-footer .nav-item.logout {
    color: rgba(255,255,255,0.6);
}

.sidebar-footer .nav-item.logout:hover {
    color: #ff6b6b;
    background: rgba(255,100,100,0.1);
}

/* Sidebar Badge */
.nav-item .badge {
    margin-left: auto;
    float: right;
}

/* ========================================
 * 5. Login Sayfası
 * ======================================== */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 32px;
    background: white;
    border: 1px solid var(--gl-gray-100);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--gl-gray-900);
}

.login-title::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #fc6d26, #e24329);
    border-radius: 8px;
}

/* ========================================
 * 6. Kartlar (Card)
 * ======================================== */
.card {
    background: var(--gl-white);
    border: 1px solid var(--gl-gray-100);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gl-gray-900);
    margin: 0;
}

/* ========================================
 * 7. Butonlar
 * ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--gl-blue);
    color: white;
    border-color: var(--gl-blue);
}

.btn-primary:hover {
    background: #1068bf;
    border-color: #1068bf;
}

.btn-success {
    background: var(--gl-green);
    color: white;
    border-color: var(--gl-green);
}

.btn-success:hover {
    background: #217645;
    border-color: #217645;
}

.btn-danger {
    background: var(--gl-red);
    color: white;
    border-color: var(--gl-red);
}

.btn-danger:hover {
    background: #c91c00;
    border-color: #c91c00;
}

.btn-warning {
    background: transparent;
    color: var(--gl-gray-900);
    border: 1px solid var(--gl-gray-100);
}

.btn-warning:hover {
    background: var(--gl-gray-50);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* ========================================
 * 8. Formlar
 * ======================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gl-gray-900);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gl-gray-400);
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--gl-blue);
    box-shadow: 0 0 0 3px rgba(31, 117, 203, 0.2);
    outline: none;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23525252' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    padding-right: 36px;
    height: 38px;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* ========================================
 * 9. Tablolar
 * ======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 8px;
    background-color: var(--gl-gray-50);
    font-weight: 600;
    color: var(--gl-gray-700);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: left;
}

.table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--gl-gray-100);
    font-size: 13px;
    color: var(--gl-gray-900);
}

.table tbody tr:hover {
    background-color: var(--gl-gray-50);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.actions {
    display: flex;
    gap: 8px;
}

/* ========================================
 * 10. Badge'ler
 * ======================================== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #dff9e5;
    color: #0d532a;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #fce4e4;
    color: #8d1409;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ========================================
 * 11. Uyarılar (Alert)
 * ======================================== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 4px solid;
}

.alert-success {
    background: #dff9e5;
    color: #0d532a;
    border-left-color: var(--gl-green);
}

.alert-danger {
    background: #fce4e4;
    color: #8d1409;
    border-left-color: var(--gl-red);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #f59e0b;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #06b6d4;
}

/* ========================================
 * 12. Toast Bildirimleri
 * ======================================== */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem 2rem 1rem 1rem;
    border-left: 4px solid #ffc107;
    animation: toastSlideIn 0.3s ease;
    cursor: pointer;
}

.toast.toast-success {
    border-left-color: var(--gl-green);
}

.toast.toast-danger {
    border-left-color: var(--gl-red);
}

.toast.toast-info {
    border-left-color: var(--gl-blue);
}

.toast-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #856404;
}

.toast.toast-success .toast-header { color: #0d532a; }
.toast.toast-danger .toast-header { color: #8d1409; }
.toast.toast-info .toast-header { color: #0c5460; }

.toast-body {
    font-size: 0.85rem;
    color: var(--gl-gray-700);
    line-height: 1.4;
}

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

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

/* ========================================
 * 13. Filtre Paneli
 * ======================================== */
.filtre-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filtre-baslik {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 14px;
    color: var(--gl-gray-900);
}

.filtre-baslik i:last-child {
    transition: transform 0.3s ease;
}

.filtre-panel.collapsed .filtre-baslik i:last-child {
    transform: rotate(-90deg);
}

.filtre-panel.collapsed .filtre-icerik {
    display: none;
}

.filtre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
    margin-top: 1rem;
}

.filtre-grup {
    display: flex;
    flex-direction: column;
}

.filtre-grup label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gl-gray-700);
    margin-bottom: 4px;
}

.filtre-input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filtre-input:focus {
    border-color: var(--gl-blue);
    box-shadow: 0 0 0 3px rgba(31, 117, 203, 0.2);
    outline: none;
}

.aktif-filtreler {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.aktif-filtre {
    background: var(--gl-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.aktif-filtre .kaldir {
    cursor: pointer;
    font-weight: bold;
    margin-left: 4px;
}

/* ========================================
 * 17. Detay Sayfası (Sidebar Layout)
 * ======================================== */
.detail-layout {
    display: flex;
    gap: 24px;
}

.detail-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.detail-sidebar-card {
    background: white;
    border: 1px solid var(--gl-gray-100);
    border-radius: 4px;
    position: sticky;
    top: 24px;
}

.detail-sidebar-header {
    padding: 16px;
    background: var(--gl-gray-50);
    border-bottom: 1px solid var(--gl-gray-100);
}

.detail-sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.detail-nav-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    color: var(--gl-gray-700);
    border-left: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.detail-nav-item:hover {
    background: rgba(41, 41, 97, 0.03);
    color: var(--gl-purple);
}

.detail-nav-item.active {
    background: rgba(41, 41, 97, 0.05);
    color: var(--gl-purple);
    border-left-color: var(--gl-purple);
    font-weight: 600;
}

/* ========================================
 * 18. Intro.js Tema Overrides
 * ======================================== */
.introjs-tooltip {
    max-width: min(400px, 90vw);
    font-family: inherit;
}

.introjs-tooltip-title {
    color: var(--gl-purple);
    font-weight: 600;
}

.introjs-button {
    background: var(--gl-purple);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-shadow: none;
}

.introjs-button:hover {
    background: #1f1f4d;
}

.introjs-button:focus {
    box-shadow: 0 0 0 3px rgba(41, 41, 97, 0.3);
}

.introjs-progressbar {
    background: var(--gl-purple);
}

.introjs-helperLayer {
    box-shadow: rgba(41, 41, 97, 0.5) 0px 0px 0px 5000px;
}

/* Help Tour Button */
.help-tour-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #292961 0%, #1f1f4d 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 998;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-tour-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* ========================================
 * 19. Mobil Uyumluluk
 * ======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    background: var(--gl-purple);
    border: none;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
    color: white;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1000;
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
        padding: 60px 16px 16px;
    }

    .card {
        padding: 12px;
    }

    .detail-layout {
        flex-direction: column;
    }

    .detail-sidebar {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        padding: 20px 24px;
    }

    .card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 56px 12px 12px;
    }

    .card {
        padding: 10px;
    }
}

/* ========================================
 * 20. Yazdırma Stilleri
 * ======================================== */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .btn,
    .help-tour-btn,
    .filtre-panel {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* ========================================
 * 21. Utility Sınıfları
 * ======================================== */
.hover-shadow-sm:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.hover-shadow-blue:hover {
    border-color: var(--gl-blue);
    box-shadow: 0 0 0 3px rgba(31,117,203,0.2);
}

.hover-bg-gray:hover {
    background-color: #e9ecef;
}
