/* ============================================
   SMP IBA Custom CSS - Dark Blue Theme
   ============================================ */

/* === Root Variables === */
:root {
    --primary-color: #003366;
    --primary-light: #0055a5;
    --primary-dark: #001a33;
    --secondary-color: #f5f5f5;
    --text-dark: #333333;
    --text-muted: #6c757d;
}

/* === Global Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    /* Offset for fixed-top navbar so content isn't hidden under header */
    padding-top: 72px;
}

/* === Bootstrap Override === */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* === Navbar Styles === */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.nav-link {
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* === Hero Slider === */
.carousel-item {
    height: 550px;
    position: relative;
}

.carousel-item img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.carousel-caption {
    bottom: 50%;
    transform: translateY(50%);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.carousel-caption h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
}

/* === Page Header === */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    min-height: 200px;
    display: flex;
    align-items: center;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    text-decoration: none;
}

/* === Card Styles === */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.card-img-top {
    transition: all 0.3s ease;
}

.hover-card:hover .card-img-top {
    transform: scale(1.05);
}

.card-title {
    color: var(--primary-color);
}

/* === Gallery Styles === */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 51, 102, 0.9));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* === Content Styles === */
.content-text,
.content-page,
.content-article {
    font-size: 1.05rem;
    line-height: 1.8;
}

.content-page h2,
.content-article h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-page p,
.content-article p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.content-page img,
.content-article img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
}

/* === Animation === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* === Section Spacing === */
section {
    padding: 4rem 0;
}

.section-title {
    margin-bottom: 3rem;
}

/* === Footer Styles === */
footer a:hover {
    color: var(--primary-light) !important;
    text-decoration: underline;
}

/* === Form Styles === */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

textarea.form-control {
    resize: vertical;
}

/* === Pagination Styles === */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    margin: 0 3px;
    border-radius: 5px;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
}

/* === Badge Styles === */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 5px;
}

/* === Alert Styles === */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-info {
    background-color: #e3f2fd;
    color: #0277bd;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
}

/* === Responsive === */
@media (max-width: 768px) {
    .carousel-item {
        height: 400px;
    }
    
    .carousel-caption h1 {
        font-size: 2rem;
    }
    
    .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
}

/* Adjust top offset for smaller viewports where navbar is slightly shorter */
@media (max-width: 992px) {
    body {
        padding-top: 66px;
    }
}

@media (max-width: 576px) {
    .carousel-item {
        height: 300px;
    }
    
    .carousel-caption h1 {
        font-size: 1.5rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
}

/* === Utility Classes === */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.rounded {
    border-radius: 10px !important;
}

/* === Loading Animation === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Smooth Scroll === */
html {
    scroll-behavior: smooth;
}

/* === Selection Color === */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}