/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', 'Tahoma', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    direction: rtl;
    text-align: right;
}

/* Container Layout */
.container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    z-index: 100;
    max-height: 100vh;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #0f0f1a;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #2a2a3e;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #3a3a4e;
}

.logo {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 52, 96, 0.2);
    margin-bottom: 5px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.3) 0%, rgba(15, 52, 96, 0.1) 100%);
    backdrop-filter: blur(10px);
}

.logo h2 {
    font-size: 22px;
    font-weight: 600;
    background: linear-gradient(135deg, #16a085 0%, #0d7a6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 10px 8px 20px 8px;
    flex: 1 1 auto;
    gap: 3px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #2a2a3e #0f0f1a;
}

.nav-item {
    padding: 13px 16px;
    color: #b8b8b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    margin: 0 4px;
    font-weight: 400;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-height: 44px;
    flex-shrink: 0;
}

.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #16a085 0%, #0d7a6b 100%);
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px 0 0 4px;
    opacity: 0;
}

.nav-item:hover {
    background: linear-gradient(90deg, rgba(42, 42, 62, 0.8) 0%, rgba(26, 26, 46, 0.6) 100%);
    color: #ffffff;
    transform: translateX(-4px);
    box-shadow: -2px 0 8px rgba(22, 160, 133, 0.15);
}

.nav-item:hover::before {
    height: 50%;
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(15, 52, 96, 0.9) 0%, rgba(22, 160, 133, 0.15) 100%);
    color: #ffffff;
    border-right: 4px solid #16a085;
    font-weight: 600;
    box-shadow: -2px 0 12px rgba(22, 160, 133, 0.3), inset 0 0 20px rgba(22, 160, 133, 0.05);
    transform: translateX(-2px);
}

.nav-item.active::before {
    height: 100%;
    width: 4px;
    right: -4px;
    opacity: 1;
}

/* Badge styles for notifications */
.nav-item span {
    margin-right: auto;
    font-size: 11px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Sub-menu styles - Clear distinction from main menu */
.nav-item.has-submenu {
    position: relative;
}

.nav-item.has-submenu::after {
    content: '▼';
    margin-right: auto;
    font-size: 9px;
    transition: transform 0.3s ease;
    opacity: 0.6;
    margin-left: 8px;
}

.nav-item.has-submenu:hover::after {
    opacity: 1;
}

.nav-item.has-submenu.open::after {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-submenu {
    display: none;
    padding: 5px 0 5px 0;
    background: linear-gradient(90deg, rgba(13, 13, 26, 0.8) 0%, rgba(10, 10, 20, 0.6) 100%);
    border-radius: 0 0 8px 8px;
    margin: 3px 4px 0 4px;
    overflow: hidden;
    border-right: 2px solid rgba(22, 160, 133, 0.3);
    border-left: 2px solid rgba(22, 160, 133, 0.1);
    animation: slideDown 0.3s ease;
}

.nav-item.has-submenu.open + .nav-submenu {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

.nav-submenu .nav-item {
    padding: 10px 16px 10px 35px;
    font-size: 13px;
    color: #a0a0a0;
    margin: 2px 0;
    font-weight: 400;
    background: transparent;
    border-right: none;
}

.nav-submenu .nav-item::before {
    display: none;
}

.nav-submenu .nav-item::after {
    content: '→';
    position: absolute;
    right: 16px;
    font-size: 12px;
    opacity: 0.4;
    transition: all 0.2s ease;
}

.nav-submenu .nav-item:hover {
    background: linear-gradient(90deg, rgba(26, 26, 46, 0.6) 0%, rgba(15, 52, 96, 0.3) 100%);
    color: #16a085;
    transform: translateX(-2px);
    padding-right: 20px;
}

.nav-submenu .nav-item:hover::after {
    opacity: 1;
    right: 12px;
}

.nav-submenu .nav-item.active {
    background: linear-gradient(90deg, rgba(15, 52, 96, 0.7) 0%, rgba(22, 160, 133, 0.2) 100%);
    color: #16a085;
    border-right: 3px solid #16a085;
    font-weight: 500;
    padding-right: 20px;
}

.nav-submenu .nav-item.active::after {
    opacity: 1;
    color: #16a085;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background-color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-bar input {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    width: 400px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #16a085;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #16a085;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.content h1 {
    margin-bottom: 30px;
    font-size: 32px;
    color: #1a1a2e;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 40px;
}

.stat-info h3 {
    font-size: 32px;
    color: #1a1a2e;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    color: #1a1a2e;
}

.link {
    color: #16a085;
    text-decoration: none;
    font-size: 14px;
}

.link:hover {
    text-decoration: underline;
}

/* List Styles */
.list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: background-color 0.3s;
}

.list-item:hover {
    background-color: #f0f0f0;
}

.list-item-icon {
    font-size: 24px;
}

.list-item-content {
    flex: 1;
}

.list-item-content h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #1a1a2e;
}

.list-item-content p {
    font-size: 14px;
    color: #666;
}

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

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

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

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

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

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    min-width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.btn-primary {
    background-color: #16a085;
    color: white;
}

.btn-primary:hover {
    background-color: #138f75;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.table thead {
    background-color: #f8f9fa;
}

.table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    vertical-align: middle;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    text-align: right;
    vertical-align: middle;
}

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

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 100%;
    overflow-x: auto;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: transform 0.2s;
    flex-shrink: 0;
    min-width: fit-content;
    white-space: nowrap;
}

.action-btn:hover {
    transform: scale(1.2);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #16a085;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-x: hidden;
    animation: slideIn 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.modal-header h2 {
    font-size: 24px;
    color: #1a1a2e;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #dc3545;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: #2c3e50;
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    margin-left: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dark-mode-toggle:hover {
    background: #34495e;
    transform: scale(1.1);
}

/* Dark Mode Styles */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .main-content {
    background-color: #1a1a1a;
}

body.dark-mode .header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #404040;
}

body.dark-mode .dark-mode-toggle {
    background: #f39c12;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #f1c40f;
}

body.dark-mode .search-bar input {
    background: #404040;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .search-bar input::placeholder {
    color: #999;
}

body.dark-mode .content {
    color: #e0e0e0;
}

body.dark-mode .card {
    background: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .card-header {
    background: #3a3a3a;
    border-bottom: 1px solid #404040;
    color: #e0e0e0;
}

body.dark-mode .stat-card {
    background: #2d2d2d;
    border: 1px solid #404040;
    color: #e0e0e0;
}

body.dark-mode .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

body.dark-mode .stat-info p {
    color: #999;
}

body.dark-mode .list-item {
    background-color: #353535;
    border: 1px solid #404040;
}

body.dark-mode .list-item:hover {
    background-color: #404040;
}

body.dark-mode .list-item-content h4 {
    color: #e0e0e0;
}

body.dark-mode .list-item-content p {
    color: #b0b0b0;
}

body.dark-mode .table {
    color: #e0e0e0;
    background-color: #2d2d2d;
}

body.dark-mode .table thead {
    background: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .table th {
    color: #e0e0e0;
    border-bottom-color: #555;
}

body.dark-mode .table td {
    color: #e0e0e0;
    border-bottom-color: #404040;
    background-color: #2d2d2d;
}

body.dark-mode .table tbody tr {
    border-bottom: 1px solid #404040;
    background-color: #2d2d2d;
}

body.dark-mode .table tbody tr:hover {
    background: #353535;
}

body.dark-mode .table tbody tr:hover td {
    background: #353535;
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-controls button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination-controls button:hover:not(:disabled) {
    background: #16a085;
    color: white;
    border-color: #16a085;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls button.active {
    background: #16a085;
    color: white;
    border-color: #16a085;
    font-weight: 600;
}

.pagination-controls span {
    padding: 8px;
    color: #666;
}

/* Dark Mode Pagination */
body.dark-mode .pagination-controls button {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .pagination-controls button:hover:not(:disabled) {
    background: #4a9eff;
    border-color: #4a9eff;
}

body.dark-mode .pagination-controls button.active {
    background: #4a9eff;
    border-color: #4a9eff;
}

body.dark-mode .pagination-controls span {
    color: #999;
}

body.dark-mode .modal-content {
    background: #2d2d2d;
    border: 1px solid #404040;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-bottom: 1px solid #404040;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #404040;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #666;
    background: #4a4a4a;
}

body.dark-mode select {
    background: #404040;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode select:focus {
    border-color: #666;
    background: #4a4a4a;
}

body.dark-mode .btn-secondary {
    background: #404040;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #4a4a4a;
}

body.dark-mode button {
    color: #e0e0e0;
}

body.dark-mode button[style*="background: white"],
body.dark-mode button[style*="background: #f0f0f0"] {
    background: #404040 !important;
    border-color: #555 !important;
    color: #e0e0e0 !important;
}

body.dark-mode button[style*="background: white"]:hover,
body.dark-mode button[style*="background: #f0f0f0"]:hover {
    background: #4a4a4a !important;
}

body.dark-mode .appointment-card,
body.dark-mode .note-card,
body.dark-mode .settings-section {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .note-card.from-lawyer {
    background: #2a3a4a;
}

body.dark-mode .note-card.from-client {
    background: #2a3a2a;
}

body.dark-mode .setting-item {
    border-bottom: 1px solid #404040;
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4 {
    color: #e0e0e0;
}

body.dark-mode p {
    color: #b0b0b0;
}

body.dark-mode .form-actions {
    border-top: 1px solid #404040;
}

body.dark-mode .close-modal {
    color: #999;
}

body.dark-mode .close-modal:hover {
    color: #dc3545;
}

/* Folder Cards */
.folder-card {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.folder-card:hover {
    background: #f0f0f0;
}

.folder-card h4 {
    margin: 10px 0 5px 0;
    color: #1a1a2e;
}

.folder-card p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

body.dark-mode .folder-card {
    background: #353535;
    border: 1px solid #404040;
}

body.dark-mode .folder-card:hover {
    background: #404040;
}

body.dark-mode .folder-card h4 {
    color: #e0e0e0;
}

body.dark-mode .folder-card p {
    color: #b0b0b0;
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
}

body.dark-mode .calendar-grid {
    background: #555;
    border-color: #555;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

body.dark-mode .calendar-day-header {
    background: #3a3a3a;
    color: #e0e0e0;
}

.calendar-day {
    background: white;
    padding: 10px;
    min-height: 100px;
}

body.dark-mode .calendar-day {
    background: #2d2d2d;
    color: #e0e0e0;
}

.calendar-day.other-month {
    color: #ccc;
}

body.dark-mode .calendar-day.other-month {
    color: #666;
}

.calendar-day.today {
    border: 2px solid #16a085;
}

.event-badge {
    display: block;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 5px;
    text-align: center;
}

.event-badge.client-meeting {
    background: #16a085;
    color: white;
}

.event-badge.court {
    background: #0f3460;
    color: white;
}

.event-badge.consultation {
    background: #16a085;
    color: white;
}

.event-badge.mediation {
    background: #f39c12;
    color: white;
}

.event-badge.deadline {
    background: #dc3545;
    color: white;
}

.event-item-sidebar {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 10px;
}

body.dark-mode .event-item-sidebar {
    background: #353535;
    border: 1px solid #404040;
}

.event-item-sidebar strong {
    color: #1a1a2e;
}

body.dark-mode .event-item-sidebar strong {
    color: #e0e0e0;
}

.event-item-sidebar p {
    color: #666;
    font-size: 14px;
    margin: 5px 0 0 0;
}

body.dark-mode .event-item-sidebar p {
    color: #b0b0b0;
}

.event-item-sidebar .event-time {
    color: #666;
    font-size: 12px;
}

body.dark-mode .event-item-sidebar .event-time {
    color: #999;
}

/* Notification Center Styles */
.notification-bell-container {
    position: relative;
    margin-left: 15px;
}

.notification-bell {
    background: transparent;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.notification-bell:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

body.dark-mode .notification-bell {
    color: #e0e0e0;
}

body.dark-mode .notification-bell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.notification-badge.pulse {
    animation: badgePulse 1s ease-out;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.notification-dropdown {
    position: fixed;
    top: auto;
    bottom: auto;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: dropdownSlide 0.3s ease-out;
    overflow: hidden;
    box-sizing: border-box;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-dropdown.active {
    display: flex;
}

body.dark-mode .notification-dropdown {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .notification-header {
    border-bottom-color: #404040;
}

.notification-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

body.dark-mode .notification-header h3 {
    color: #e0e0e0;
}

.notification-actions {
    display: flex;
    gap: 10px;
}

.notification-action-btn {
    background: none;
    border: none;
    color: #3498db;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.notification-action-btn:hover {
    background: rgba(52, 152, 219, 0.1);
}

body.dark-mode .notification-action-btn {
    color: #5dade2;
}

.notification-filters {
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

body.dark-mode .notification-filters {
    border-bottom-color: #404040;
}

.notification-filter-btn {
    background: #f5f5f5;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.notification-filter-btn:hover,
.notification-filter-btn.active {
    background: #3498db;
    color: white;
}

body.dark-mode .notification-filter-btn {
    background: #404040;
    color: #e0e0e0;
}

body.dark-mode .notification-filter-btn:hover,
body.dark-mode .notification-filter-btn.active {
    background: #3498db;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: calc(100vh - 250px);
    overscroll-behavior: contain;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.dark-mode .notification-list::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.dark-mode .notification-list::-webkit-scrollbar-thumb {
    background: #666;
}

body.dark-mode .notification-list::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: #f0f8ff;
}

body.dark-mode .notification-item {
    border-bottom-color: #404040;
}

body.dark-mode .notification-item:hover {
    background: #353535;
}

body.dark-mode .notification-item.unread {
    background: #2a3a4a;
}

.notification-icon {
    font-size: 24px;
    margin-left: 12px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    cursor: pointer;
}

.notification-content .notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    border: none;
    margin-bottom: 5px;
}

.notification-content h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

body.dark-mode .notification-content h4 {
    color: #e0e0e0;
}

.notification-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    margin-right: 10px;
}

.notification-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

body.dark-mode .notification-content p {
    color: #b0b0b0;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0;
    transition: all 0.2s;
    position: absolute;
    top: 15px;
    left: 10px;
}

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

.notification-close:hover {
    color: #dc3545;
}

.notification-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.notification-empty p {
    margin: 10px 0 0 0;
    font-size: 15px;
}

/* Priority indicators */
.notification-item.priority-high::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dc3545;
}

.notification-item.priority-medium::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ffc107;
}

/* Global Search Styles */
.global-search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1001;
    animation: searchDropdownSlide 0.2s ease-out;
}

@keyframes searchDropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark-mode .global-search-dropdown {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.search-category {
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .search-category {
    border-bottom-color: #404040;
}

.search-category:last-child {
    border-bottom: none;
}

.search-category-title {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    background: #f8f9fa;
}

body.dark-mode .search-category-title {
    background: #353535;
    color: #888;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

body.dark-mode .search-result-item {
    border-bottom-color: #404040;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background: #f0f8ff;
}

body.dark-mode .search-result-item:hover,
body.dark-mode .search-result-item.selected {
    background: #2a3a4a;
}

.search-result-icon {
    font-size: 24px;
    margin-left: 12px;
    flex-shrink: 0;
}

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

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .search-result-title {
    color: #e0e0e0;
}

.search-result-title mark {
    background: #ffd700;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

body.dark-mode .search-result-title mark {
    background: #3498db;
    color: #fff;
}

.search-result-subtitle {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .search-result-subtitle {
    color: #999;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.highlight-flash {
    animation: highlightFlash 2s ease-out;
}

@keyframes highlightFlash {
    0%, 100% {
        background: transparent;
    }
    20%, 80% {
        background: #ffd700;
    }
}

body.dark-mode .highlight-flash {
    animation: highlightFlashDark 2s ease-out;
}

@keyframes highlightFlashDark {
    0%, 100% {
        background: transparent;
    }
    20%, 80% {
        background: #3498db;
    }
}

/* Mobile Hamburger Menu */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    color: #2c3e50;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1002;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .hamburger-menu {
    color: #e0e0e0;
}

body.dark-mode .hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .hamburger-menu {
        display: block;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        right: -280px;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        right: 0;
    }

    body.dark-mode .sidebar {
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    }

    /* Show mobile overlay when sidebar is open */
    .sidebar.mobile-open ~ .mobile-overlay,
    .mobile-overlay.active {
        display: block;
    }

    /* Adjust main content */
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar input {
        width: 250px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        overflow-x: hidden;
    }
    
    .form-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 16px;
        min-width: auto;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-header h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .action-buttons {
        gap: 3px;
    }
    
    .action-btn {
        font-size: 16px;
        padding: 4px;
    }
    
    .dark-mode-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-left: 10px;
    }
    
    .notification-bell-container {
        margin-left: 10px;
    }
    
    .notification-dropdown {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        right: 10px !important;
        left: 10px !important;
        max-height: calc(100vh - 80px);
    }
    
    .notification-list {
        max-height: calc(100vh - 200px);
    }
    
    .notification-bell {
        font-size: 20px;
        padding: 6px;
    }
    
    .notification-filters {
        padding: 8px 15px;
    }
    
    .notification-filter-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

