/* ========================================
   SHRI SAI COLLEGE OF PHARMACY
   Custom Styles - Optimized & Clean
   ======================================== */

/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
    --primary-color: #0a4d8f;
    --secondary-color: #1e88e5;
    --accent-color: #ffa726;
    --success-color: #00c853;
    --dark-color: #1a2332;
    --light-bg: #f8f9fc;
}

/* ========================================
   BASE RESET & OVERFLOW FIX
   ======================================== */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    position: relative;
}

/* ========================================
   CUSTOM UTILITY CLASSES
   ======================================== */
.bg-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.text-primary-custom {
    color: #f2f3f5;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(10, 77, 143, 0.3);
    color: white;
}

.badge-custom {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   LAYOUT & SECTIONS
   ======================================== */
section {
    overflow-x: hidden !important;
    overflow-y: visible;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

.container, .container-fluid {
    overflow-x: hidden !important;
    max-width: 100%;
}

.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100%;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ========================================
   CAROUSEL
   ======================================== */
#heroCarousel {
    width: 100%;
    max-width: 100vw;
    overflow: hidden !important;
}

#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
    height: auto !important;
    line-height: 0;
    max-width: 100vw;
    overflow: hidden !important;
}

#heroCarousel .carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
    max-width: 100vw;
}

@media (min-width: 992px) {
    #heroCarousel .carousel-item img {
        max-height: 700px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    #heroCarousel .carousel-item img {
        max-height: 500px;
    }
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */
.card {
    max-width: 100%;
    overflow: hidden;
}

.hover-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.hover-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
}

.feature-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 22px;
    opacity: 0.2;
    z-index: -1;
}

.stats-counter {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   FACILITY & GALLERY
   ======================================== */
.facility-card {
    position: relative;
    overflow: hidden !important;
    border-radius: 15px;
    height: 300px;
}

.facility-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 35, 50, 0.9) 100%);
    z-index: 1;
}

.facility-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 2;
    color: white;
}

.gallery-item {
    position: relative;
    overflow: hidden !important;
    border-radius: 15px;
    height: 250px;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline {
    position: relative;
    padding-left: 30px;
    overflow: visible !important;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 5px;
    width: 15px;
    height: 15px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--accent-color);
}

/* ========================================
   TESTIMONIALS
   ======================================== */
.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    position: relative;
    border-left: 5px solid var(--accent-color);
    overflow: visible !important;
}

.quote-icon {
    position: absolute;
    top: -20px;
    right: 30px;
    font-size: 4rem;
    color: var(--accent-color);
    opacity: 0.2;
}

/* ========================================
   NAVBAR & HEADER
   ======================================== */
.navbar-custom {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--secondary-color);
}

/* Top bar hide on mobile */
@media (max-width: 991px) {
    .bg-primary-custom.text-white.py-2 {
        display: none !important;
    }
    .navbar-collapse {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .navbar-toggler {
        display: none;
    }
    .navbar-collapse {
        display: flex !important;
    }
}

/* ========================================
   MOBILE MENU (OFFCANVAS)
   ======================================== */
.offcanvas-start {
    width: 280px !important;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
}

.offcanvas {
    transition: transform 0.3s ease-in-out;
}

.offcanvas-body .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.offcanvas-body .nav-link:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding-left: 1.5rem !important;
}

.offcanvas-body .nav-link i {
    transition: transform 0.3s ease;
}

.offcanvas-body .nav-link:hover i {
    transform: translateX(5px);
}

/* ========================================
   FLOATING SHAPES
   ======================================== */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    pointer-events: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.shape {
    position: absolute;
    opacity: 0.05;
}

.shape-1 {
    top: 10%;
    left: 5%;
    width: 100px;
    height: 100px;
    background: var(--accent-color);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    bottom: 15%;
    right: 8%;
    width: 150px;
    height: 150px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden !important;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    background: linear-gradient(135deg, #1a2332 0%, #0a4d8f 100%);
}

footer .container {
    max-width: 100%;
    overflow-x: hidden !important;
}

.footer-links .hover-link,
.footer-contact .hover-link {
    transition: all 0.3s ease;
}

.footer-links .hover-link:hover,
.footer-contact .hover-link:hover {
    color: var(--accent-color) !important;
    padding-left: 5px;
}

footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

footer .btn-outline-light:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

footer h5 {
    position: relative;
    padding-bottom: 10px;
}

footer h5::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

/* ========================================
   POSITION UTILITIES
   ======================================== */
.position-absolute {
    max-width: 100%;
}

.position-relative {
    overflow: hidden !important;
}

#about .position-relative {
    overflow: visible !important;
}

#about .position-absolute.bottom-0 {
    max-width: 250px;
}

/* ========================================
   TEXT & IMAGES
   ======================================== */
img {
    max-width: 100%;
    height: auto;
}

.btn {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ========================================
   PREVENT OVERFLOW
   ======================================== */
*:not(html):not(body):not(.dropdown-menu):not(.modal):not(.popover):not(.tooltip) {
    max-width: 100%;
}

.breadcrumb {
    flex-wrap: wrap;
}

.dropdown-menu,
.modal,
.popover,
.tooltip {
    max-width: none !important;
}

/* ========================================
   🔥 DESKTOP: 4 COLUMNS (DEFAULT)
   ======================================== */
@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}

/* ========================================
   TABLET: 2 COLUMNS
   ======================================== */
@media (min-width: 768px) and (max-width: 991px) {
    .col-lg-3 {
        flex: 0 0 auto;
        width: 50%;
    }
    
    .stats-counter {
        font-size: 2.5rem;
    }
    
    .feature-icon-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .facility-card {
        height: 250px;
    }
    
    .gallery-item {
        height: 200px;
    }
}

/* ========================================
   🔥🔥🔥 MOBILE: 2 COLUMNS - FORCED 🔥🔥🔥
   ======================================== */
@media (max-width: 767px) {
    
    /* === GLOBAL CONTAINER & ROW === */
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    /* === FORCE 2 COLUMNS FOR ALL TARGETED SECTIONS === */
    .col-lg-3.col-6,
    .col-md-6.col-6 {
        flex: 0 0 auto !important;
        width: 50% !important;
        max-width: 50% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* === ADJUST ROW MARGINS === */
    .row.g-4,
    .row.g-3 {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    
    /* === QUICK FEATURES SECTION === */
    .feature-icon-wrapper {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-icon-wrapper i {
        font-size: 1.2rem !important;
    }
    
    .col-6 h5 {
        font-size: 0.85rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .col-6 p.small {
        font-size: 0.7rem !important;
        line-height: 1.3;
    }
    
    /* === STATS SECTION === */
    .stats-counter {
        font-size: 1.5rem !important;
    }
    
    .bg-primary-custom .col-6 .fs-1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .bg-primary-custom .col-6 p {
        font-size: 0.75rem !important;
    }
    
    /* === COURSE SECTION === */
    #course .col-6 .border.rounded-3 {
        padding: 0.5rem !important;
    }
    
    #course .col-6 h6 {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    #course .col-6 p.small {
        font-size: 0.65rem !important;
    }
    
    /* === GENERAL MOBILE ADJUSTMENTS === */
    .display-4, .display-5, .display-6 {
        font-size: calc(1.5rem + 1.5vw) !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-lg-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    #about .position-absolute.bottom-0 {
        max-width: 200px;
        padding: 1rem !important;
    }
    
    .shape-1 {
        width: 60px;
        height: 60px;
        left: 2%;
    }
    
    .shape-2 {
        width: 80px;
        height: 80px;
        right: 2%;
    }
    
    .cta-section::before {
        width: 300px;
        height: 300px;
        right: -20%;
    }
    
    .facility-card {
        height: 200px;
    }
    
    .gallery-item {
        height: 180px;
    }
    
    .timeline {
        padding-left: 25px;
    }
    
    .timeline-item::before {
        left: -31px;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .quote-icon {
        font-size: 3rem;
        right: 20px;
    }
    
    .offcanvas-start {
        width: 260px !important;
    }
    
    footer .col-lg-4,
    footer .col-lg-2,
    footer .col-lg-3 {
        margin-bottom: 2rem;
    }
    
    footer h5 {
        font-size: 1.1rem;
    }
    
    footer .btn-outline-light {
        width: 35px;
        height: 35px;
    }
}

/* ========================================
   VERY SMALL SCREENS (MAX 480px)
   ======================================== */
@media (max-width: 480px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .col-6,
    .col-lg-3.col-6,
    .col-md-6.col-6 {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    
    .display-4 {
        font-size: 1.8rem !important;
    }
    
    .display-5 {
        font-size: 1.5rem !important;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    .stats-counter {
        font-size: 1.3rem !important;
    }
    
    .feature-icon-wrapper {
        width: 45px !important;
        height: 45px !important;
    }
    
    .feature-icon-wrapper i {
        font-size: 1rem !important;
    }
    
    .col-6 h5 {
        font-size: 0.75rem !important;
    }
    
    .col-6 p.small {
        font-size: 0.65rem !important;
    }
    
    #course .col-6 h6 {
        font-size: 0.7rem !important;
    }
    
    #course .col-6 p.small {
        font-size: 0.6rem !important;
    }
    
    .facility-card {
        height: 180px;
    }
    
    .gallery-item {
        height: 150px;
    }
    
    .badge-custom {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }
    
    .cta-section::before {
        width: 200px;
        height: 200px;
    }
    
    footer .d-flex.gap-2 {
        gap: 0.5rem !important;
    }
    
    footer .btn-outline-light {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem;
    }
    
    footer h5 {
        font-size: 1rem;
    }
    
    footer small {
        font-size: 0.8rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar-custom,
    #backToTop,
    .cta-section {
        display: none !important;
    }
}