/* Modern Layout Styles */
:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #334155;
    --content-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.top-nav-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.top-nav-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.top-nav-title a:hover {
    color: var(--primary-hover);
}

.top-nav-links {
    display: flex;
    gap: 20px;
}

.top-nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.top-nav-links a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* Sidebar Navigation */
.sidebar-wrapper {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 999;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

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

.sidebar-wrapper::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 3px;
}

.side-nav {
    padding: 20px 0;
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-nav-item {
    margin: 4px 12px;
}

.side-nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.side-nav-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s;
}

.side-nav-item a:hover {
    background: var(--sidebar-hover);
    transform: translateX(4px);
}

.side-nav-item a:hover::before {
    height: 60%;
}

.side-nav-item a.active {
    background: var(--primary-color);
    color: white;
}

.side-nav-item a.btn-danger {
    background: var(--danger-color);
    color: white;
    margin-top: 12px;
}

.side-nav-item a.btn-danger:hover {
    background: var(--danger-hover);
}

/* Main Content Area */
.main-content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 24px;
    transition: margin-left 0.3s ease;
}

.main-content-wrapper.no-sidebar {
    margin-left: 0;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Flash Messages */
.message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

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

.message.success {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.message.error {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.message.warning {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.message.info {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* Floating Help Button */
.floating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s;
    z-index: 1001;
    border: none;
}

.floating-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar-wrapper {
        transform: translateX(-100%);
    }

    .sidebar-wrapper.mobile-open {
        transform: translateX(0);
    }

    .main-content-wrapper {
        margin-left: 0 !important;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 10px 14px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 20px;
    }

    .top-nav {
        padding-left: 60px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Cards and Panels */
.card {
    background: var(--content-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

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

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

table tbody tr:hover {
    background: var(--bg-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
