/* Custom styles for Contractor Admin Panel */

/* Body and general styles */
body {
    background-color: #FFEDD4;
    color: #212529;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

html {
    overflow-x: hidden; /* Ensure no horizontal scroll */
}

/* Sidebar styles */
.sidebar {
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    padding-top: 20px;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 50%;
    left: 250px;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border: none;
    border-radius: 0 15px 15px 0;
    color: white;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
    transform: translateY(-50%) translateX(5px);
}

.sidebar-toggle-btn i {
    font-size: 1.5rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.sidebar.hidden + .sidebar-toggle-btn {
    left: 0;
}

.sidebar.hidden + .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Logo styles */
.logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-img {
    max-width: 150px;
    height: auto;
    background: transparent;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: #495057;
}

.sidebar .nav-link.active {
    color: #ffffff;
    background-color: #FF6B35;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

.sidebar .logout {
    color: #dc3545;
}

.sidebar .logout:hover {
    color: #ffffff;
    background-color: #dc3545;
}

/* Main content styles */
main {
    margin-left: 250px;
    width: calc(100vw - 250px);
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
    max-width: calc(100vw - 250px);
}

.sidebar.hidden ~ main {
    margin-left: 0;
    width: 100vw;
    max-width: 100vw;
}

/* Ensure content fits within available space */
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col-lg-3, .col-md-6, .col-12, .col-lg-6 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Force content to fit */
.card {
    max-width: 100%;
    box-sizing: border-box;
}

.card-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
        padding-top: 10px;
    }
    main {
        left: 0;
        width: 100vw;
        padding: 15px;
    }
    .sidebar-toggle-btn {
        display: none;
    }
    .stat-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    .stat-card h3 {
        font-size: 1.5rem;
    }
    .card-header h5 {
        font-size: 1rem;
    }
    .sidebar .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .logo-img {
        max-width: 120px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 575.98px) {
    main {
        padding: 10px;
    }
    .stat-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    .stat-card h3 {
        font-size: 1.25rem;
    }
    .stat-card p {
        font-size: 0.85rem;
    }
    .card {
        margin-bottom: 1rem;
    }
    .card-header {
        padding: 0.75rem;
    }
    .card-header h5 {
        font-size: 0.9rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .expertise-item, .project-card, .job-card, .achievement-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    .sidebar .nav-link {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .sidebar .nav-link i {
        margin-right: 0.25rem;
    }
    .logo-img {
        max-width: 100px;
    }
    .logo-container {
        margin-bottom: 0.5rem;
    }
}

/* Touch-friendly interactions for mobile */
@media (max-width: 767.98px) {
    .sidebar .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .stat-card, .expertise-item, .project-card, .job-card, .achievement-card {
        min-height: 44px;
    }
}

.section.active {
    display: block;
}

/* Card styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

/* Stat cards */
.stat-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    color: #FF6B35;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* Expertise items */
.expertise-item {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.expertise-item:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.expertise-item h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.expertise-item p {
    color: #6c757d;
    margin: 0;
}

/* Project cards */
.project-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.project-card h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: #6c757d;
    margin: 0;
}

/* Job cards */
.job-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.job-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.job-card h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.job-card p {
    color: #6c757d;
    margin: 0;
}

/* Achievement cards */
.achievement-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.achievement-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.achievement-card h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.achievement-card p {
    color: #6c757d;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        width: 200px;
    }
    main {
        margin-left: 200px;
    }
    .sidebar.hidden ~ main {
        margin-left: 0;
    }
    .sidebar-toggle-btn {
        left: 200px;
    }
    .sidebar.hidden + .sidebar-toggle-btn {
        left: 0;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        position: relative;
    }
    main {
        margin-left: 0;
    }
    .sidebar-toggle-btn {
        display: none;
    }
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Scrollable sidebar navigation container */
.sidebar-nav-container {
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-nav-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-container::-webkit-scrollbar-track {
    background: #343a40;
}

.sidebar-nav-container::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 3px;
}

.sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animation for section transitions */
.section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
