/* ===== Responsive Design CSS ===== */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Container Responsive */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Mobile First - Default (320px and up) */
@media (min-width: 320px) {
    .container {
        max-width: 100%;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    body {
        font-size: 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    body {
        font-size: 16px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #fff;
        padding: 15px;
        border-radius: 5px;
        margin-top: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .nav-item {
        margin: 5px 0;
    }
}

/* Course Cards Responsive */
@media (max-width: 767px) {
    .course-card, .card {
        margin-bottom: 20px;
    }
    
    .row > [class*='col-'] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Video Player Responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mobile Video Controls */
video {
    width: 100%;
    height: auto;
    max-width: 100%;
}

video::-webkit-media-controls-panel {
    display: flex !important;
    opacity: 1 !important;
}

/* Forms Responsive */
@media (max-width: 767px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Tables Responsive */
@media (max-width: 767px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Dashboard Cards */
@media (max-width: 575px) {
    .dashboard-card {
        margin-bottom: 15px;
    }
    
    .stats-box {
        padding: 15px;
    }
}

/* Footer Responsive */
@media (max-width: 767px) {
    footer {
        text-align: center;
        padding: 20px 10px;
    }
    
    footer .row > div {
        margin-bottom: 20px;
    }
}

/* Touch Friendly Buttons */
@media (max-width: 767px) {
    .btn, button, a.btn {
        min-height: 44px;
        padding: 12px 20px;
    }
}
