/* ISNM Responsive Design CSS - Medical Blue Theme */

/* Mobile First Approach */
:root {
    --primary-color: #1a237e;
    --secondary-color: #3949ab;
    --accent-color: #ffd700;
    --success-color: #2e7d32;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Responsive Styles */
* {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--dark-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container and Grid */
.container {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Dashboard Responsive */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Responsive */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid white;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.1);
    border-left-color: white;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 10px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Responsive */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    background: var(--light-bg);
}

.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* Stats Grid Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.stat-content p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Tables Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: 600px;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.table th,
.table td {
    padding: 12px 15px;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background: var(--light-bg);
    font-weight: 600;
}

/* Forms Responsive */
.form-control {
    display: block;
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-text);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.form-control:focus {
    color: var(--dark-text);
    background-color: white;
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Buttons Responsive */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 12px 24px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

.btn-success {
    color: white;
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-info {
    color: white;
    background: var(--info-color);
    border-color: var(--info-color);
}

.btn-warning {
    color: white;
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    color: white;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Cards Responsive */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: white;
    background-clip: border-box;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.card-body {
    flex: 1 1 auto;
    padding: 25px;
}

.card-title {
    margin-bottom: 15px;
    color: var(--dark-text);
    font-weight: 600;
}

/* Modal Responsive */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 10px;
    max-width: 500px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 25px;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    border-bottom-right-radius: 15px;
    border-bottom-left-radius: 15px;
}

/* Organogram Responsive */
.organogram-container {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.org-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.org-node {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 15px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    border: 3px solid transparent;
    min-width: 200px;
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

.org-node:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Application Form Responsive */
.application-form-container {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
}

/* Student Portal Responsive */
.student-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.profile-section {
    background: white;
    border-radius: 15px;
    padding: 25px 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    transition: var(--transition);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: 15px;
}

/* Mobile Responsive Breakpoints */

/* Extra Small Devices (phones, 575px and down) */
@media (max-width: 575.98px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .dashboard-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .table {
        min-width: 500px;
    }
    
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .modal-content {
        border-radius: 0;
        height: 90vh;
        overflow-y: auto;
    }
    
    .org-level {
        flex-direction: column;
        align-items: center;
    }
    
    .org-branch {
        width: 100%;
    }
    
    .org-branch::before,
    .org-horizontal {
        display: none;
    }
    
    .org-node {
        min-width: auto;
        max-width: 100%;
        margin: 10px 0;
    }
    
    .application-form-container {
        padding: 20px 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .student-header {
        padding: 20px 15px;
    }
    
    .profile-section {
        padding: 20px 15px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Mobile Hero Section */
    .hero-content {
        padding: 1rem 0.5rem;
    }
    
    .cinematic-title {
        font-size: 1.6rem;
        margin: 0 0.5rem;
        letter-spacing: 0.4px;
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.8),
            2px 2px 0px rgba(0, 0, 0, 0.6),
            3px 3px 0px rgba(0, 0, 0, 0.4);
    }
    
    .cinematic-title:hover {
        transform: translateY(-1px);
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.9),
            2px 2px 0px rgba(0, 0, 0, 0.7),
            3px 3px 0px rgba(0, 0, 0, 0.5);
    }
    
    .hero-subtitle p {
        font-size: 1rem;
        margin: 1rem 0;
    }
    
    .hero-stats {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Mobile Navigation - handled by navigation.css */
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .org-node {
        min-width: 180px;
        max-width: 220px;
    }
    
    .modal-dialog {
        max-width: 90%;
    }
    
    /* Tablet Hero Section */
    .cinematic-title {
        font-size: 2.2rem;
        margin: 0 0.8rem;
        letter-spacing: 0.5px;
    }
    
    .hero-subtitle p {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Tablet Navigation - handled by navigation.css */
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .org-node {
        min-width: 190px;
        max-width: 230px;
    }
    
    .dashboard-header {
        padding: 20px 25px;
    }
    
    .header-left h1 {
        font-size: 1.7rem;
    }
    
    /* Medium Tablet Hero Section */
    .cinematic-title {
        font-size: 2.4rem;
        margin: 0 1rem;
    }
    
    .hero-subtitle p {
        font-size: 1.3rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Medium Tablet Navigation - handled by navigation.css */
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .org-node {
        min-width: 200px;
        max-width: 240px;
    }
    
    /* Desktop Hero Section */
    .cinematic-title {
        font-size: 2.5rem;
        margin: 0 1rem;
    }
    
    .hero-subtitle p {
        font-size: 1.4rem;
    }
    
    .hero-stats {
        gap: 2.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.95rem;
    }
    
    /* Desktop Navigation - handled by navigation.css */
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .dashboard-header {
        padding: 20px 30px;
    }
    
    .header-left h1 {
        font-size: 2rem;
    }
    
    /* Large Desktop Hero Section */
    .cinematic-title {
        font-size: 2.6rem;
        margin: 0 1rem;
    }
    
    .hero-subtitle p {
        font-size: 1.5rem;
    }
    
    .hero-stats {
        gap: 3rem;
    }
    
    .stat-number {
        font-size: 2.8rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    /* Large Desktop Navigation - handled by navigation.css */
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .sidebar {
        height: auto;
        max-height: 100vh;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-nav {
        padding: 10px 0;
    }
    
    .sidebar-nav .nav-link {
        padding: 10px 20px;
    }
    
    .dashboard-header {
        padding: 10px 20px;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .modal,
    .header-right {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .dashboard-header {
        border-bottom: 1px solid #000;
        box-shadow: none;
    }
    
    .stat-card,
    .card,
    .profile-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #0000CD;
        --dark-text: #000000;
        --light-bg: #FFFFFF;
        --border-color: #000000;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .card,
    .stat-card {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sidebar,
    .stat-card,
    .btn,
    .org-node {
        transition: none;
    }
    
    .stat-card:hover,
    .btn:hover,
    .org-node:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1a1a1a;
        --dark-text: #ffffff;
        --border-color: #333333;
    }
    
    .main-content {
        background: var(--light-bg);
        color: var(--dark-text);
    }
    
    .dashboard-header,
    .card,
    .stat-card,
    .profile-section {
        background: #2d2d2d;
        color: var(--dark-text);
    }
    
    .form-control {
        background: #2d2d2d;
        color: var(--dark-text);
        border-color: var(--border-color);
    }
    
    .table {
        color: var(--dark-text);
    }
    
    .table th {
        background: #3d3d3d;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .org-node {
        min-height: 44px;
        min-width: 44px;
    }
    
    .sidebar-nav .nav-link {
        padding: 20px;
    }
    
    .stat-card {
        padding: 30px 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 30px 25px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: no-preference) {
    .sidebar {
        transition: transform 0.3s ease-in-out;
    }
    
    .stat-card {
        transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    }
    
    .btn {
        transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Main Page Responsive Styles */

/* Hero Section Responsive */
.hero-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem 1rem;
}

/* Cinematic Title Responsive */
.cinematic-title-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.cinematic-title-track {
    display: flex;
    animation: cinematicScroll 20s linear infinite;
    transform-style: preserve-3d;
}

.cinematic-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.6rem;
    font-weight: 400;
    color: #ffffff;
    background: transparent !important;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.8),
        4px 4px 0px rgba(0, 0, 0, 0.6),
        6px 6px 0px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    margin: 0 1rem;
    flex-shrink: 0;
    letter-spacing: 0.6px;
    line-height: 1.3;
    transform: none;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
    position: relative;
    z-index: 5;
    border: none;
}

.cinematic-title:hover {
    transform: translateY(-2px);
    text-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.9),
        4px 4px 0px rgba(0, 0, 0, 0.7),
        6px 6px 0px rgba(0, 0, 0, 0.5);
}

@keyframes cinematicScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Hero Stats Responsive */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hero Subtitle Responsive */
.hero-subtitle {
    margin: 1.5rem 0;
}

.hero-subtitle p {
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-style: italic;
}

/* Navigation Responsive - handled by isnm-style.css */

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25) !important;
}

.error-message {
    color: var(--accent-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success States */
.success {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25) !important;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   EXTRA SMALL DEVICES (360px and below)
   ============================================ */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 0 10px;
    }

    body {
        font-size: 0.85rem;
    }

    h1 { font-size: 1.3rem !important; }
    h2 { font-size: 1.15rem !important; }
    h3 { font-size: 1rem !important; }
    h4 { font-size: 0.9rem !important; }

    .section-title {
        font-size: 1.3rem !important;
    }

    .section-subtitle {
        font-size: 0.85rem !important;
    }

    .hero-section {
        min-height: 100vh !important;
        height: 100dvh !important;
    }

    .hero-content {
        padding: 0.5rem 0.25rem !important;
    }

    .cinematic-title {
        font-size: 1.2rem !important;
        padding-right: 30px !important;
        letter-spacing: 0.3px !important;
    }

    .hero-subtitle p {
        font-size: 0.8rem !important;
    }

    .hero-stats {
        gap: 6px !important;
    }

    .stat-item {
        padding: 8px 6px !important;
        min-width: 60px !important;
    }

    .stat-number {
        font-size: 1.2rem !important;
    }

    .stat-label {
        font-size: 0.65rem !important;
    }

    .btn-cinematic {
        padding: 10px 18px !important;
        font-size: 0.75rem !important;
        min-width: 140px !important;
    }

    .cta-buttons {
        gap: 6px !important;
    }

    .program-card,
    .facility-card,
    .news-card,
    .vm-card {
        padding: 1rem !important;
    }

    .news-card-img,
    .news-card-img-placeholder {
        height: 150px !important;
    }

    .about-image img {
        min-height: 200px !important;
    }

    .btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
        min-height: 38px !important;
    }

    .form-control {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }
}

/* ============================================
   FIX: Prevent horizontal overflow on all pages
   ============================================ */
.isnm-header,
.isnm-navbar,
.hero-section,
.stats-section,
.programs-section,
.about-section,
.facilities-section,
.news-section,
.cta-section,
.isnm-footer {
    overflow-x: hidden;
    max-width: 100vw;
}

.row,
.container {
    max-width: 100%;
}

/* ============================================
   FIX: Ensure proper mobile stacking
   ============================================ */
@media (max-width: 768px) {
    .hero-content .cta-buttons .btn-cinematic.btn-primary {
        font-size: 1rem !important;
        padding: 14px 28px !important;
    }

    .hero-content .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .hero-content .cta-buttons .btn-cinematic {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        font-size: 0.9rem;
        padding: 12px 24px;
    }

    .hero-overlay {
        display: block !important;
    }

    .stat-card {
        padding: 15px !important;
    }
}

/* ============================================
   iPad and tablet fixes
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-section {
        min-height: 80vh !important;
    }

    .cinematic-title {
        font-size: 2.8rem !important;
    }
}

/* ============================================
   PWA: Ensure standalone display is usable
   ============================================ */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .isnm-header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }

    .isnm-footer {
        padding-bottom: calc(0px + env(safe-area-inset-bottom));
    }
}
