/* Çınar Vinç Yönetim Sistemi - Ana CSS */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #bdc3c7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark-text);
    line-height: 1.6;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: var(--primary-color);
    color: white;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    left: -220px;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.sidebar-header h3 {
    font-size: 18px;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--secondary-color);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
}

/* Submenu styles */
.sidebar-menu .has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-menu .submenu-toggle .arrow {
    transition: transform 0.3s;
    font-size: 12px;
    margin-left: auto;
}

.sidebar-menu .has-submenu.open .arrow {
    transform: rotate(180deg);
}

.sidebar-menu .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-menu .has-submenu.open .submenu {
    max-height: 500px;
}

.sidebar-menu .submenu li a {
    padding: 12px 20px 12px 50px;
    font-size: 14px;
}

/* Main Content */
.main-content {
    margin-left: 220px;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

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

.top-bar {
    background: white;
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    color: var(--secondary-color);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    z-index: 1000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
    user-select: none;
}

.user-info:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-info i.fa-user-circle {
    color: var(--secondary-color);
    font-size: 20px;
}

.user-info i.fa-chevron-down {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
    color: #999;
}

.user-dropdown.active .user-info i.fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-menu a:first-child {
    border-radius: 4px 4px 0 0;
}

.user-dropdown-menu a:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.user-dropdown-menu a:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.user-dropdown-menu a i {
    width: 18px;
    text-align: center;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.card-header h4 {
    margin: 0;
    font-size: 18px;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: var(--light-bg);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-secondary {
    background: #95a5a6;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h5 {
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Utility Classes */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mr-10 { margin-right: 10px; }
.ml-10 { margin-left: 10px; }

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: #95a5a6; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sidebar Overlay (mobil için) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -250px;
        z-index: 9999;
    }

    .sidebar.collapsed {
        left: 0;
    }

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

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

    .form-row {
        flex-direction: column;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 10px;
        position: relative;
        z-index: 10001;
    }

    .top-bar-left {
        flex: 1;
        min-width: 0;
    }

    .top-bar-left h3 {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Kullanıcı dropdown mobilde daha küçük */
    .user-dropdown {
        position: relative;
        z-index: 10002;
    }

    .user-info span {
        display: none;
    }

    .user-info {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }

    .user-info i.fa-user-circle {
        font-size: 24px;
        margin: 0;
    }

    .user-info i.fa-chevron-down {
        display: none;
    }

    /* Dropdown menu mobile için */
    .user-dropdown-menu {
        position: absolute;
        z-index: 10003;
    }

    /* Sidebar overlay */
    .sidebar-overlay {
        z-index: 9998;
    }
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Autocomplete */
.autocomplete-results {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover {
    background: var(--light-bg);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #ccc;
}

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

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

.toast.warning {
    border-left-color: var(--warning-color);
}

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

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--dark-text);
}

.toast-message {
    font-size: 13px;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 70px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}
