/* assets/css/style.css */

/* General styles */
body {
    font-family: 'Kanit', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.min-vh-100 {
    min-height: 100vh;
}

.footer {
    margin-top: auto;
}

/* Power Teen theme colors */
.bg-power-teen {
    background-color: #1E88E5;
}

.btn-power-teen {
    background-color: #FFC107;
    border-color: #FFC107;
    color: #212529;
}

.btn-power-teen:hover {
    background-color: #E0A800;
    border-color: #E0A800;
    color: #212529;
}

.text-power-teen {
    color: #1E88E5;
}

/* Custom colors */
.bg-purple {
    background-color: #6f42c1;
}

.bg-orange {
    background-color: #fd7e14;
}

.bg-teal {
    background-color: #20c997;
}

/* Responsive sidebar */
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 56px;
        height: calc(100vh - 56px);
        border-right: 1px solid #dee2e6;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        overflow-y: auto;
        z-index: 100;
    }
    
    .main-content {
        padding-left: 20px;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -300px;
        width: 300px;
        height: calc(100vh - 56px);
        z-index: 1000;
        background-color: #f8f9fa;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    .toggle-sidebar {
        display: inline-block;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* Sidebar styles */
.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #1E88E5;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.5rem;
}

/* Card styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
}

.card-header {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom: none;
}

.card-footer {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dashboard cards */
.dashboard-card {
    height: 100%;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.dashboard-card-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .card-deck .card {
        display: block;
        margin-bottom: 1rem;
    }
}

/* Table styles */
.table th {
    font-weight: 600;
    border-top: none;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(30, 136, 229, 0.05);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Mobile table improvements */
@media (max-width: 767.98px) {
    .table-responsive-stack .table thead {
        display: none;
    }
    
    .table-responsive-stack .table tbody tr {
        display: block;
        border-bottom: 2px solid #dee2e6;
        margin-bottom: 1rem;
    }
    
    .table-responsive-stack .table tbody td {
        display: block;
        text-align: right;
        position: relative;
        padding-left: 50%;
        border-top: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .table-responsive-stack .table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 1rem;
        font-weight: 600;
        text-align: left;
    }
}

/* Badge styles */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Form styles */
.form-control, .form-select {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #1E88E5;
    box-shadow: 0 0 0 0.25rem rgba(30, 136, 229, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Button styles */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #1E88E5;
    border-color: #1E88E5;
}

.btn-primary:hover {
    background-color: #1976D2;
    border-color: #1976D2;
}

/* Button groups for mobile */
@media (max-width: 767.98px) {
    .btn-sm-block {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group-sm-vertical {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-group-sm-vertical .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        margin: 0;
    }
    
    .d-grid .btn + .btn {
        margin-top: 0.5rem;
    }
}

/* Action buttons container for better mobile display */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Login and registration page styles */
.auth-card {
    max-width: 400px;
    margin: 2rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.auth-card .card-header {
    background-color: #1E88E5;
    color: white;
    text-align: center;
    padding: 1.5rem;
}

.auth-card .card-body {
    padding: 2rem;
}

@media (max-width: 767.98px) {
    .auth-card {
        max-width: 100%;
        margin: 1rem auto;
    }
    
    .auth-card .card-body {
        padding: 1.5rem;
    }
}

/* Dashboard statistics for mobile */
@media (max-width: 767.98px) {
    .dashboard-stat-card {
        padding: 0.75rem;
    }
    
    .dashboard-stat-card h6 {
        font-size: 0.9rem;
    }
    
    .dashboard-stat-card h2 {
        font-size: 1.5rem;
    }
    
    .dashboard-stat-card i {
        font-size: 2rem;
    }
}

/* Row & column adjustments for mobile */
@media (max-width: 767.98px) {
    .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .container-fluid, .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Custom animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form layout adjustments for small screens */
@media (max-width: 767.98px) {
    .form-row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .form-row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* Alert adjustments */
.alert {
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Chart container height adjustments */
.chart-container {
    position: relative;
    min-height: 300px;
}

@media (max-width: 767.98px) {
    .chart-container {
        min-height: 200px;
    }
}

/* Navigation tabs for mobile */
@media (max-width: 767.98px) {
    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Profile page */
.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

@media (max-width: 767.98px) {
    .profile-image {
        width: 100px;
        height: 100px;
    }
}

/* Filter buttons for data tables */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-buttons .btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .sidebar, .navbar, .btn, .card-footer, .action-buttons {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    body {
        background-color: white !important;
    }
    
    .container-fluid, .container {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .col-lg-10.main-content {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .table-responsive {
        overflow: visible !important;
    }
}

/* Wrapper for sidebar content layout */
.wrapper {
    min-height: calc(100vh - 56px);
}

/* Sidebar styles */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s;
    z-index: 1000;
    padding: 15px;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    padding: 10px;
    font-size: 16px;
    display: block;
    color: #212529;
}

#sidebar ul li a {
    padding: 10px;
    font-size: 16px;
    display: block;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 5px;
}

#sidebar ul li a:hover {
    background-color: #e9ecef;
}

#sidebar ul li a.active {
    background-color: #1E88E5;
    color: white;
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content styles */
#content {
    width: 100%;
    padding: 0;
    transition: all 0.3s;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100vh - 56px);
        overflow-y: auto;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}