/* Responsive CSS for GoSoft Discovery Path
 * This file contains all responsive styling for tablets and mobile devices
 * To be used in conjunction with styles.css
 */

/* Large Tablets (992px and below) */
@media (max-width: 992px) {
    /* Layout adjustments */
    .container {
        padding: 0 15px;
    }
    
    /* Main content layout */
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex: none;
        margin-bottom: 30px;
    }
    
    /* Homepage */
    .feature-card {
        flex-basis: calc(33.33% - 20px);
    }
    
    .footer-logo {
        flex-basis: 100%;
        margin-bottom: 30px;
    }
    
    .footer-links {
        flex-basis: 30%;
    }
    
    /* Courses page */
    .paths-grid,
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    /* Challenges page */
    .challenges-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    /* Projects page */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .featured-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-image {
        flex: 0 0 100%;
        height: 200px;
    }
    
    .featured-details {
        flex: 0 0 100%;
    }
    
    /* Internship page */
    .internships-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    /* Auth pages */
    .auth-container {
        flex-direction: column;
    }
    
    .auth-image, 
    .auth-form-container {
        width: 100%;
        border-radius: 10px;
    }
    
    .auth-image {
        display: none; /* Hide image on tablet */
    }
}

/* Tablets and Small Laptops (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    /* Homepage */
    .hero h1 {
        font-size: 40px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    /* Navigation enhancements for tablets */
    .nav-links {
        display: flex;
    }
    
    .nav-links li {
        margin-right: 15px;
    }
}

/* Medium Tablets and Mobile (768px and below) */
@media (max-width: 768px) {
    /* Header and navigation */
    .page-header {
        padding: 40px 0 30px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .page-header p {
        font-size: 16px;
    }
    
    /* Hide navigation links on mobile */
    .nav-links {
        display: none;
    }
    
    /* Add mobile menu button (to be implemented with JavaScript) */
    .mobile-menu-button {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }
    
    /* Homepage */
    .feature-card {
        flex-basis: calc(50% - 20px);
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .footer-links {
        flex-basis: 45%;
    }
    
    /* Courses page */
    .paths-grid,
    .courses-grid,
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .search-sort,
    .search-filter,
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .sort-dropdown,
    .filter-group {
        width: 100%;
    }
    
    .sort-select,
    .filter-select {
        width: 100%;
    }
    
    /* Challenges page */
    .filter-section {
        flex-direction: column;
    }
    
    .filter-group {
        overflow-x: auto;
        padding-bottom: 10px;
        display: flex;
        width: 100%;
    }
    
    .challenges-tabs {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    /* Projects page */
    .featured-team-members {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline-dot {
        left: -30px;
    }
    
    /* Internship page */
    .internship-card {
        flex-direction: column;
    }
    
    .internship-company-logo {
        height: 100px;
        flex: none;
    }
    
    .application-table thead {
        display: none;
    }
    
    .application-table, 
    .application-table tbody, 
    .application-table tr, 
    .application-table td {
        display: block;
        width: 100%;
    }
    
    .application-table tr {
        margin-bottom: 20px;
        border: 1px solid var(--medium-gray);
        border-radius: 10px;
        overflow: hidden;
    }
    
    .application-table td {
        display: flex;
        justify-content: space-between;
        text-align: right;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .application-table td::before {
        content: attr(data-label);
        font-weight: 500;
        text-align: left;
        color: var(--gray);
    }
    
    .application-company {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-company-logo {
        margin-bottom: 10px;
    }
    
    /* Section headers on mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Small Mobile Devices (576px and below) */
@media (max-width: 576px) {
    /* Homepage */
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-right: 0;
    }
    
    .feature-card {
        flex-basis: 100%;
    }
    
    .stat-card {
        width: 100%;
    }
    
    .partners-logos {
        gap: 20px;
    }
    
    .partner-logo {
        width: 100px;
        height: 50px;
    }
    
    /* Auth forms */
    .auth-form-container {
        padding: 20px;
    }
    
    .oauth-buttons {
        flex-direction: column;
    }
    
    .register-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* Footer */
    .footer-links {
        flex-basis: 100%;
    }
    
    /* CTA sections */
    .cta {
        padding: 40px 0;
    }
    
    .cta h2 {
        font-size: 24px;
    }
    
    .cta p {
        font-size: 14px;
    }
    
    .cta-form {
        flex-direction: column;
    }
    
    .cta-form input {
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    .cta-form button {
        border-radius: 5px;
    }
    
    /* Course and Challenge cards */
    .course-card,
    .challenge-card,
    .project-card,
    .internship-grid-card {
        max-width: 100%;
    }
    
    /* Project timeline */
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-title {
        font-size: 16px;
    }
    
    /* Internship page */
    .completion-circle {
        width: 100px;
        height: 100px;
    }
    
    .completion-circle::before {
        width: 80px;
        height: 80px;
    }
    
    .sidebar-section .btn {
        width: 100%;
    }
    
    /* Discovery page */
    .personality-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra Small Devices (414px and below) */
@media (max-width: 414px) {
    .container {
        padding: 0 10px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    /* Adjust card layouts */
    .paths-grid,
    .courses-grid,
    .challenges-grid,
    .projects-grid,
    .internships-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .team-challenges-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tabs */
    .challenge-tab,
    .filter-tab,
    .status-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Discovery page */
    .career-path-card {
        flex: 0 0 100%;
    }
    
    /* Profile items */
    .profile-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .item-status {
        margin-left: 40px; /* Align with item name */
    }
    
    /* Tables */
    .application-table td {
        padding: 10px;
    }
    
    /* Success stories */
    .story-card {
        flex: 0 0 280px;
    }
}

/* Fix for iPhone 5/SE (320px) */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 22px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .story-card {
        flex: 0 0 260px;
    }
    
    .featured-member {
        width: 60px;
    }
    
    .featured-member-avatar {
        width: 40px;
        height: 40px;
    }
}

/* Special for iPad Pro and other large tablets in portrait mode */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .sidebar {
        flex: 0 0 240px;
    }
    
    .featured-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Styles for Landscape Orientation on Mobile */
@media (max-width: 850px) and (orientation: landscape) {
    .hero {
        padding: 40px 0;
    }
    
    .auth-container {
        padding: 20px 0;
    }
    
    .sidebar {
        margin-bottom: 20px;
    }
}

/* Dark mode preference - enhancement */
@media (prefers-color-scheme: dark) {
    /* The site is already dark-themed, but we could adjust some colors for extreme dark mode */
    :root {
        --dark: #000000;
        --dark-gray: #111111;
    }
}

/* Print styles for resumes and course materials */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    nav, footer, .btn, .sidebar, .section-buttons, .filter-section {
        display: none !important;
    }
    
    .main-content {
        display: block;
    }
    
    .page-header {
        text-align: center;
        padding: 20px 0;
    }
    
    .page-header h1 {
        color: black;
        -webkit-text-fill-color: black;
    }
    
    .page-header p {
        color: #333;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    .card, .course-card, .challenge-card, .project-card, .internship-card {
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
        color: black;
        background-color: white;
    }
    
    .card-content, .course-content, .challenge-content, .project-content, .internship-details {
        color: black;
    }
}

/* Fixes for different browsers */
/* Firefox */
@-moz-document url-prefix() {
    .progress-bar {
        background-color: rgba(51, 51, 51, 0.8);
    }
}

/* Safari */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .timeline::before {
            left: 9px;
        }
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 15px;
    background: var(--dark);
    color: white;
    z-index: 9999;
    border: 2px solid var(--blue);
}

/* Animated hamburger menu for mobile */
.hamburger {
    display: none;
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2),
.hamburger span:nth-child(3) {
    top: 9px;
}

.hamburger span:nth-child(4) {
    top: 18px;
}

.hamburger.open span:nth-child(1) {
    top: 9px;
    width: 0%;
    left: 50%;
}

.hamburger.open span:nth-child(2) {
    transform: rotate(45deg);
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg);
}

.hamburger.open span:nth-child(4) {
    top: 9px;
    width: 0%;
    left: 50%;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        margin-right: 15px;
    }
    
    /* Mobile menu (need JavaScript to toggle) */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--dark-gray);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }
    
    .mobile-menu.open {
        left: 0;
    }
    
    .mobile-menu-header {
        padding: 20px;
        border-bottom: 1px solid var(--medium-gray);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }
    
    .mobile-nav-links {
        list-style: none;
        padding: 20px;
    }
    
    .mobile-nav-links li {
        margin-bottom: 15px;
    }
    
    .mobile-nav-links a {
        color: white;
        text-decoration: none;
        font-size: 18px;
        display: block;
        padding: 10px;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }
    
    .mobile-nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-links a.active {
        color: var(--blue);
        background-color: rgba(66, 133, 244, 0.1);
    }
}