/* PKK Welfare System - Main Styles */

/* Base Styles */
body {
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    transition: margin-left 0.3s ease;
    padding-top: 80px; /* Account for fixed navbar */
}

.main-content.shifted {
    margin-left: 300px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: white !important;
}

.navbar-text {
    color: rgba(255, 255, 255, 0.9) !important;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    transition: left 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
}

.sidebar.show {
    left: 0;
}

.sidebar.pinned {
    left: 0;
    position: fixed;
    z-index: 1040;
}

.sidebar.pinned ~ .main-content {
    margin-left: 300px;
}

/* Pinned state adjustments */
body.sidebar-pinned .main-content {
    margin-left: 300px;
    transition: margin-left 0.3s ease;
}

body.sidebar-pinned .sidebar {
    left: 0;
    z-index: 1040;
}

body.sidebar-pinned .sidebar-overlay {
    display: none !important;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 2px solid var(--bs-border-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-logo {
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.sidebar-controls button {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-controls button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

#pinIcon.pinned {
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-weight: 500;
}

.menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-right: 4px solid #667eea;
    font-weight: 600;
}

.menu-section {
    padding: 1rem 1.5rem 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 0.5rem;
}

.menu-section-header {
    padding: 1.5rem 1.5rem 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-top: 1rem;
}

.menu-section-header .section-title {
    color: var(--bs-secondary-color);
}

.menu-item .badge {
    font-size: 0.7rem;
    margin-left: auto;
}

.menu-item small {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.menu-item:hover small {
    color: rgba(255, 255, 255, 0.8);
}

/* Theme Controls */
.theme-controls {
    background: var(--bs-secondary-bg);
    margin: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
}

.theme-toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.font-size-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.font-size-btn {
    background: var(--bs-secondary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.font-size-btn:hover {
    background: var(--bs-primary);
    transform: scale(1.1);
}

.font-size-label {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

.footer-link {
    color: #e3f2fd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.page-title {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-description {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Alert Enhancements */
.alert {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.alert i {
    font-size: 1.1rem;
}

/* Dashboard Cards */
.feature-card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
}

.stats-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    font-size: 2.5rem;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Font Size Classes */
.font-small {
    font-size: 0.9rem;
}

.font-normal {
    font-size: 1rem;
}

.font-large {
    font-size: 1.1rem;
}

.font-xlarge {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content.shifted {
        margin-left: 0;
    }

    .sidebar {
        width: 280px;
    }

    .navbar-text {
        display: none;
    }

    .content-wrapper {
        padding: 1rem 0;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .stats-icon {
        font-size: 2rem;
    }

    .stats-number {
        font-size: 1.5rem;
    }
}

/* Fixed Left Menu Overrides */
.sidebar { left: 0 !important; }
.main-content { margin-left: 300px !important; }
.sidebar-overlay, .sidebar-overlay.show { display: none !important; }
.btn-toggle-sidebar { display: none !important; }

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
    
    /* Desktop: sidebar pinned by default */
    body:not(.sidebar-unpinned) .sidebar {
        left: 0;
        z-index: 1040;
    }
    
    body:not(.sidebar-unpinned) .main-content {
        margin-left: 300px;
    }
}

@media (max-width: 768px) {
    /* Mobile: sidebar always overlay */
    body.sidebar-pinned .main-content {
        margin-left: 0;
    }
    
    .sidebar.pinned {
        z-index: 1050;
    }
}
