/* Prevent scroll anchoring on interactive elements */
a, button, [role="button"], .interactive {
    scroll-behavior: auto !important;
    scroll-margin-top: 0 !important;
    scroll-snap-margin-top: 0 !important;
}

/* Add specific overrides for focus behavior */
a:focus, button:focus, [role="button"]:focus, .interactive:focus {
    outline: none !important;
}

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

body {
    background-color: #141414; /* Darker background matching modern-sidebar */
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    color: #e4e4e4;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Ensure html also fills height */
html {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Full height layout - apply only to pages that need it via class */
body.full-height-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Common content container for all pages */
.content-container {
    padding: 20px;
    height: calc(100vh - 40px);
    margin-left: 200px; /* Account for sidebar */
}

.content-container.sidebar-collapsed {
    margin-left: 60px;
}

/* Main content wrapper for child pages - ensures full height */
.content-wrapper, main, .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styles */
.sidebar {
    width: 200px;
    background-color: #262421;
    color: #e4e4e4;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease;
    z-index: 100;
}

.sidebar.collapsed {
    width: 60px;
}

.logo {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #3a3a36;
}

.logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

.sidebar.collapsed .logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    object-position: left center;
}

.nav-tabs {
    list-style: none;
    flex: 1;
    padding: 16px 0;
}

.nav-tabs li {
    margin-bottom: 4px;
}

.nav-tabs li a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #a7a7a7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-tabs li a:hover {
    background-color: #302e2b;
    color: #e4e4e4;
}

.nav-tabs li.active a {
    background-color: rgba(127, 166, 80, 0.1);
    color: #7fa650;
    border-left: 3px solid #7fa650;
}

.nav-tabs li a i {
    margin-right: 12px;
    width: 18px;
    text-align: center;
}

.sidebar.collapsed .nav-tabs li a span {
    display: none;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #3a3a36;
}

.user-info {
    display: flex;
    align-items: center;
}

.avatar {
    width: 28px;
    height: 28px;
    background-color: #3a3a36;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.username {
    font-size: 13px;
}

.sidebar.collapsed .username {
    display: none;
}

/* Main Content Area */
.content {
    flex: 1;
    margin-left: 200px;
    padding: 0;
    width: calc(100% - 200px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed + .content {
    margin-left: 60px;
    width: calc(100% - 60px);
}

.content-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3a36;
}

.content-header h2 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.content-header h2 i {
    margin-right: 10px;
    color: #7fa650;
}

/* Card styling */
.card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: none;
    background-color: #262421;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background-color: #1e1c1a;
    border-bottom: 1px solid #3a3a36;
    color: #e4e4e4;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
    background-color: #262421;
}

/* Responsive design adjustments */
@media (max-width: 992px) {
    .sidebar:not(:hover) {
        width: 60px;
    }
    
    .sidebar:not(:hover) .logo span, 
    .sidebar:not(:hover) .nav-tabs li a span, 
    .sidebar:not(:hover) .username {
        display: none;
    }
    
    .content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    
    .sidebar:hover {
        width: 200px;
    }
    
    .sidebar:hover .logo span, 
    .sidebar:hover .nav-tabs li a span, 
    .sidebar:hover .username {
        display: inline;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 10px;
    }
}