/* Navigaatio */
.navbar {
    padding: 0;
}

.navbar-brand {
    padding: 1rem;
    margin-right: 0;
}

.nav-link {
    padding: 1rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsiivisuus */
@media (max-width: 991.98px) {
    .sidebar {
        min-height: 100vh;
        width: 250px;
        padding: 0;
    }
    .content {
        padding-top: 4.5rem;
        margin-top: 56px;
    }
}

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

.sidebar {
    background-color: #23272b !important;
    color: #fff;
    width: 250px;
    height: 100vh;
    padding: 0;
    z-index: 1045;
    overflow: hidden;
}

.sidebar-sticky {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .sidebar-brand {
    color: #fd7e14 !important;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    display: block;
    text-decoration: none;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.sidebar .nav-link {
    color: #fff !important;
    padding: 0.75rem 2rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    opacity: 0.95;
    white-space: nowrap;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #fd7e14 !important;
    background-color: rgba(253, 126, 20, 0.08);
    opacity: 1;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Ensure navigation container can scroll when needed */
.sidebar .nav {
    overflow: visible;
}

/* Asetukset-valikon tyylit */
.sidebar .nav-item.mt-auto {
    margin-top: auto !important;
}

.sidebar .collapse .nav-link {
    padding-left: 3rem;
    font-size: 0.95rem;
}

/* Responsiivisuus pienille näytöille */
@media (max-height: 600px) {
    .sidebar .nav-link {
        padding: 0.5rem 2rem;
    }
    
    .sidebar .collapse .nav-link {
        padding: 0.4rem 3rem;
    }
    
    .sidebar .sidebar-brand {
        padding: 0.75rem 2rem;
        font-size: 1.3rem;
    }
}

@media (max-height: 500px) {
    .sidebar .nav-link {
        padding: 0.4rem 2rem;
    }
    
    .sidebar .collapse .nav-link {
        padding: 0.3rem 3rem;
    }
    
    .sidebar .sidebar-brand {
        padding: 0.5rem 2rem;
        font-size: 1.2rem;
    }
}

.main-area {
    margin-left: 250px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
}

.content {
    flex-grow: 1;
    padding: 2rem 2rem 2rem 2rem;
    min-width: 0;
    margin-left: 0!important;
}

@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1045;
        overflow: hidden;
    }
    .content {
        margin-left: 250px;
        padding-top: 2rem;
    }
}

/* Mobiiliyhteensopivuus */
@media (max-width: 991.98px) {
    .app-container {
        display: flex;
        flex-direction: column;
    }
    
    .main-area {
        margin-left: 0;
        width: 100%;
        flex: 1;
    }
    
    .content {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 1rem;
    }
    
    .sidebar {
        height: 100vh;
        width: 250px;
        padding: 0;
        position: fixed;
        left: -250px;
        top: 0;
        z-index: 1045;
        overflow: hidden;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .topbar {
        padding: 0.5rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1051;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .topbar .container-fluid {
        padding: 0;
    }
    
    .topbar .navbar-toggler {
        border: 1px solid #dee2e6;
        padding: 0.25rem 0.5rem;
    }
    
    .topbar .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.25);
    }
    
    .messages-float {
        position: fixed;
        top: 5rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        z-index: 2000;
    }
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    width: 100%;
    padding-left: 0;
}

/* Varmistetaan, että offcanvas-lg sidebarilla on sama taustaväri myös mobiilissa */
.offcanvas,
.offcanvas-start,
.sidebar.offcanvas,
.sidebar.offcanvas-lg {
    background-color: #23272b !important;
    overflow: hidden;
}

/* Override Bootstrap's offcanvas overflow behavior */
.offcanvas-body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar scrollbar styles for when content overflows */
.sidebar-sticky::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: rgba(253, 126, 20, 0.5);
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(253, 126, 20, 0.7);
}



.topbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-bottom: 1px solid #e5e5e5;
    min-height: 56px;
    z-index: 1051;
    position: sticky;
    top: 0;
}

.topbar .breadcrumb {
    margin-bottom: 0;
    background: none;
    font-size: 1rem;
}

.topbar .dropdown .btn {
    min-width: 180px;
    text-align: left;
}

@media (max-width: 991.98px) {
    .topbar .breadcrumb {
        font-size: 0.95rem;
    }
    .topbar .dropdown .btn {
        min-width: 120px;
        font-size: 0.95rem;
    }
}

.messages-float {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 2000;
    max-width: 350px;
    width: 100%;
}

.messages-float .alert {
    opacity: 0.95;
    background: rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.messages-float .alert-success {
    background: rgba(25, 135, 84, 0.90) !important;
    color: #fff;
}

.messages-float .alert-danger,
.messages-float .alert-error {
    background: rgba(220, 53, 69, 0.90) !important;
    color: #fff;
}

.messages-float .alert-info {
    background: rgba(13, 110, 253, 0.90) !important;
    color: #fff;
}

.messages-float .alert-warning {
    background: rgba(255, 193, 7, 0.90) !important;
    color: #212529;
}

.btn-primary {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #e8590c;
    border-color: #e8590c;
    color: #fff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus {
    background-color: #b52a37;
    border-color: #b52a37;
    color: #fff;
}

.btn-outline-secondary {
    background-color: #fff;
    border-color: #dee2e6;
    color: #23272b;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #23272b;
}

/* Yhteyshenkilöwidgetin tyylit */
.contact-list {
    max-height: 400px;
    overflow-y: auto;
}

.contact-item {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.contact-item:hover {
    background-color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.contact-info {
    font-size: 0.875rem;
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: #0d6efd;
    text-decoration: none;
}

.contact-item .btn-success {
    transition: all 0.2s ease;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.contact-item .btn-success:hover {
    transform: scale(1.05);
}

.contact-item .badge {
    font-size: 0.75em;
}

/* Responsiivisuus yhteyshenkilöwidgetille */
@media (max-width: 768px) {
    .contact-list {
        max-height: 300px;
    }
    
    .contact-item {
        padding: 0.5rem;
    }
    
    .contact-info {
        font-size: 0.8rem;
    }
}
