/* Responsive Design Styles */

/* Extra Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .display-1 { font-size: 6rem; }
    .display-2 { font-size: 5.5rem; }
    .display-3 { font-size: 4.5rem; }
    .display-4 { font-size: 3.5rem; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.125rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Navigation */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 4rem 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-section .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Cards */
    .card-columns {
        column-count: 2;
    }
    
    /* Portfolio Grid */
    .portfolio-item {
        margin-bottom: 2rem;
    }
    
    /* Project Cards */
    .project-card .card-body {
        padding: 1.25rem;
    }
    
    /* Sidebar */
    .sticky-top {
        top: 80px !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    /* Typography */
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    /* Navigation */
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        text-align: center;
        padding: 0.75rem;
        margin: 0.25rem 0;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero-section .btn-lg {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    /* Cards */
    .card-columns {
        column-count: 1;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Typography */
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2.25rem; }
    .display-3 { font-size: 2rem; }
    .display-4 { font-size: 1.75rem; }
    .display-5 { font-size: 1.5rem; }
    .display-6 { font-size: 1.25rem; }
    
    .lead {
        font-size: 1rem;
        font-weight: 400;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        text-align: center;
        padding: 0.75rem;
        margin: 0.25rem 0;
        border-radius: 0.375rem;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        background-color: rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-image i {
        font-size: 4rem !important;
    }
    
    /* Main Content */
    .main-content {
        padding-top: 4rem;
        margin-top: 0;
    }
    
    /* Sections */
    section {
        padding: 3rem 0 !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
    
    /* Buttons */
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        border-radius: 0.375rem !important;
    }
    
    /* Forms */
    .form-control {
        font-size: 1rem; /* Prevents zoom on iOS */
    }
    
    .form-control-lg {
        font-size: 1.125rem;
    }
    
    .form-control-sm {
        font-size: 0.875rem;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem;
        white-space: nowrap;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0 !important;
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 1.5rem;
    }
    
    /* Skills Section */
    .skills-section .card {
        text-align: center;
    }
    
    .skills-section i {
        font-size: 2.5rem !important;
    }
    
    /* Portfolio */
    .portfolio-item {
        margin-bottom: 1.5rem;
    }
    
    .portfolio-overlay {
        position: relative !important;
        opacity: 1 !important;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 1rem;
        margin-top: -1px;
    }
    
    /* Project Cards */
    .project-card .tech-stack {
        flex-wrap: wrap;
    }
    
    .project-card .badge {
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
    }
    
    /* Admin Panel Mobile */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1050;
    }
    
    .admin-sidebar.show {
        left: 0;
    }
    
    .admin-content {
        padding: 1rem;
        margin-left: 0;
    }
    
    .admin-mobile-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1051;
        background: var(--bs-primary);
        border: none;
        color: white;
        padding: 0.5rem;
        border-radius: 0.375rem;
    }
    
    /* Statistics Cards */
    .stat-card {
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Charts */
    .chart-container {
        padding: 1rem;
    }
    
    /* Tutorial Content */
    .tutorial-content {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .tutorial-content h1 {
        font-size: 1.5rem;
    }
    
    .tutorial-content h2 {
        font-size: 1.25rem;
    }
    
    .tutorial-content h3 {
        font-size: 1.125rem;
    }
    
    /* Code Blocks */
    .code-block-wrapper {
        margin: 1rem -15px;
        border-radius: 0;
    }
    
    .code-block-wrapper pre {
        font-size: 0.8rem;
        padding: 0.75rem;
        overflow-x: auto;
    }
    
    .copy-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Search */
    .search-results .card {
        margin-bottom: 1rem;
    }
    
    /* Contact Form */
    .contact-form .form-floating {
        margin-bottom: 1rem;
    }
    
    /* Software Cards */
    .software-card .rating-stars {
        font-size: 0.8rem;
    }
    
    .software-card .download-info {
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-section .display-4 {
        font-size: 1.5rem;
    }
    
    .hero-image {
        display: none;
    }
    
    section {
        padding: 2rem 0 !important;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image i,
    .skills-section i,
    .error-page i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .pagination,
    .modal,
    .dropdown,
    .admin-sidebar {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .text-white {
        color: black !important;
    }
    
    .bg-primary,
    .bg-dark {
        background: white !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .portfolio-card:hover,
    .project-card:hover,
    .software-card:hover {
        transform: none;
    }
}

/* Focus improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    a:focus,
    button:focus,
    .form-control:focus,
    .btn:focus {
        outline: 2px solid var(--bs-primary);
        outline-offset: 2px;
    }
}

/* Dark mode media query */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #121212;
        --bs-body-color: #e9ecef;
    }
    
    .bg-light {
        background-color: #1e1e1e !important;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
    
    .card {
        background-color: #1e1e1e;
        border-color: #343a40;
    }
    
    .navbar-dark {
        background-color: #0d1117 !important;
    }
    
    .footer {
        background-color: #0d1117 !important;
    }
}