/* Responsive Design */

/* Prevent layout changes in the 818px to 768px range for game cards */
@media (max-width: 818px) and (min-width: 769px) {
    .game-item {
        min-height: 200px;
    }
    
    .game-thumbnail {
        width: 350px;
        height: 200px;
    }
    
    .game-info {
        padding: 0px 16px 0px 16px;
        gap: 20px;
    }
    
    .game-content {
        padding: 0;
        height: 100%;
        justify-content: space-between;
    }
    
    .game-content .game-title {
        flex-shrink: 0;
        margin-bottom: 6px;
    }
    
    .game-content .game-description {
        flex-grow: 2;
        display: flex;
        align-items: center;
        margin-bottom: 0;
        padding: 8px 0;
        height: 100px;
        overflow: hidden;
    }
    
    .game-title {
        font-size: 1.3rem;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .game-description {
        font-size: 1.0rem;
        height: 100px;
        line-height: 1.5;
    }
    
    .game-buttons {
        gap: 12px;
        margin-top: 6px;
        width: 100%;
        flex-shrink: 0;
    }
    
    .game-buttons .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex: 1;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 20px 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        color: #ffffff;
        opacity: 1;
        line-height: 1;
        margin-bottom: 3px;
        margin-top: 3px;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .profile-pic {
        width: 100px;
        height: 100px;
    }
    
    .profile-section {
        gap: 5px;
    }
    
    .social-buttons {
        gap: 14px;
        margin-top: 5px;
    }
    
    .social-btn {
        width: 40px;
        height: 40px;
    }
    
    .social-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .hero-buttons {
        gap: 8px;
        margin-top: 8px;
    }
    
    .hero-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .hero-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .profile-section {
        gap: 15px;
    }
    
    .project-card {
        padding: 6px 15px 12px 15px;
        margin-bottom: 20px;
    }
    
    .project-image {
        max-height: 200px;
        margin-bottom: 10px;
    }
    
    .project-logo {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .project-logo-container {
        padding-bottom: 10px;
    }
    
    .project-content {
        padding: 0;
    }
    
    .project-description {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .project-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        text-align: center;
        width: 100%;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 350px;
        margin: 20px auto 0 auto;
    }
    
    .course-item {
        height: auto;
        max-width: 100%;
    }
    
    .course-thumbnail {
        height: auto;
        object-fit: cover;
        width: 100%;
    }
    
    .course-info {
        padding: 10px;
    }
    
    .course-title {
        font-size: 1.1rem; /* Reduced from 1.2rem */
    }
    
    .course-description {
        font-size: 0.85rem; /* Reduced from 0.9rem */
        margin-bottom: 16px;
    }
    
    .tutorial-item {
        flex-direction: column;
        margin-top: 20px;
        max-width: 350px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .game-item {
        flex-direction: column;
        margin-top: 20px;
        max-width: 400px; /* Slightly larger than tutorial items */
        margin-left: auto;
        margin-right: auto;
    }
    
    .tutorial-thumbnail {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    .game-thumbnail {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    .tutorial-info {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .game-info {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .tutorial-content {
        text-align: left;
    }
    
    .game-content {
        text-align: left;
    }
    
    .game-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px; /* Add some space on mobile */
        width: 100%; /* Full width on mobile */
    }
    
    .game-buttons .btn {
        padding: 10px 16px; /* Slightly larger padding on mobile for easier tapping */
        font-size: 0.95rem;
        width: 100%; /* Full width buttons on mobile */
        flex: none; /* Remove flex behavior on mobile since they're stacked */
    }
    
    .tutorial-title {
        font-size: 1.0rem; /* Reduced from 1.1rem */
    }
    
    .game-title {
        font-size: 1.2rem; /* Increased from 1.1rem for mobile */
    }
    
    .tutorial-description {
        font-size: 0.8rem; /* Reduced from 0.85rem */
        margin-bottom: 12px;
    }
    
    .game-content .game-description {
        font-size: 0.9rem; /* Increased from 0.8rem for mobile */
        margin-bottom: 12px;
        height: auto; /* Auto height to fit text content */
        overflow: visible; /* Allow text to show */
        display: flex;
        align-items: flex-start; /* Align to top */
        padding: 2px 8px 8px 8px; /* Keep padding consistent */
    }
    
    .game-description {
        font-size: 0.9rem; /* Increased from 0.8rem for mobile */
        margin-bottom: 12px;
        height: auto; /* Auto height to fit text content */
        overflow: visible; /* Allow text to show */
        display: flex;
        align-items: flex-start; /* Align to top */
    }
    
    .btn-youtube {
        padding: 6px 10px;
        font-size: 13px;
        align-self: center;
    }
    
    .btn-youtube svg {
        width: 24px;
        height: 24px;
    }
    
    /* About Section Mobile */
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 20px; /* Reduced from 25px */
        min-height: auto;
        align-items: center;
    }
    
    .about-text {
        text-align: center;
        order: 2;
    }
    
    .about-image {
        order: 1;
    }
    
    .about-greeting {
        font-size: 1.3rem; /* Reduced from 1.5rem */
        margin-bottom: 8px; /* Reduced from 12px */
    }
    
    .about-description {
        font-size: 0.95rem; /* Reduced from 1.05rem */
        margin-bottom: 8px; /* Reduced from 10px */
    }
    
    .about-description {
        font-size: 0.95rem; /* Reduced from 1.05rem */
        margin-bottom: 12px; /* Reduced from 16px */
    }
    
    .companies-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .companies-list li {
        font-size: 0.9rem;
        padding: 3px 0;
    }
    
    .about-pic {
        width: 100px;
        height: 100px;
    }
    
    /* Necrozone Overlay Mobile */
    .necrozone-overlay .project-content {
        position: absolute;
        bottom: 40px;
        left: 20px;
        right: 20px;
        background: none;
        padding: 0;
        margin: 0;
    }
    
    .necrozone-overlay .project-description {
        display: none;
    }
    
    .necrozone-overlay .project-links {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    
    .necrozone-overlay .btn {
        min-width: 120px;
        max-width: 160px;
    }
    
    .necrozone-overlay .project-image {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    /* Gallery Mobile Responsiveness */
    .gallery-modal-content {
        margin: 5% auto;
        width: 98%;
        max-height: 85vh;
    }
    
    .gallery-header {
        padding: 15px 20px;
    }
    
    .gallery-header h2 {
        font-size: 1.5rem;
    }
    
    .gallery-tabs {
        padding: 0 20px;
        flex-wrap: wrap;
    }
    
    .gallery-tab {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        padding: 20px;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .image-modal-content {
        padding: 20px;
    }
    
    .image-close {
        top: 10px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    #modalImage {
        max-width: 95%;
        max-height: 60%;
    }
    
    .image-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-download,
    .btn-copy {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    /* Necrozone Overlay Small Screens */
    .necrozone-overlay .project-content {
        position: absolute;
        bottom: 25px;
        left: 20px;
        right: 20px;
        background: none;
        padding: 0;
        margin: 0;
    }
    
    .necrozone-overlay .project-links {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
    
    .necrozone-overlay .btn {
        min-width: 100px;
        max-width: 130px;
        font-size: clamp(8px, 1.8vw, 10px);
        padding: clamp(4px, 1.2vw, 6px) clamp(6px, 1.8vw, 8px);
    }
    
    .necrozone-overlay .project-image {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 15px 0;
    }
    
    .hero h1 {
        font-size: 1.6rem;
        color: #ffffff;
        opacity: 1;
        line-height: 1;
        margin-bottom: 2px;
        margin-top: 2px;
    }
    
    .profile-pic {
        width: 80px;
        height: 80px;
    }
    
    .profile-section {
        gap: 4px;
    }
    
    .social-buttons {
        gap: 12px;
        margin-top: 4px;
    }
    
    .social-btn {
        width: 35px;
        height: 35px;
    }
    
    .social-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .hero-buttons {
        gap: 6px;
        margin-top: 6px;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
        min-width: 100px;
        justify-content: center;
    }
    
    .hero-btn svg {
        width: 12px;
        height: 12px;
    }
    
    .projects-section {
        padding-top: 20px;
    }
    
    .contact-section {
        padding: 15px 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .courses-grid {
        max-width: 300px;
        gap: 16px;
    }
    
    .course-thumbnail {
        height: auto;
        object-fit: cover;
        width: 100%;
    }
    
    .course-info {
        padding: 8px;
    }
    
    .course-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .course-description {
        font-size: 0.85rem;
        margin-bottom: 14px;
    }
    
    .tutorial-item {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .game-item {
        max-width: 320px; /* Slightly larger than tutorial items */
        margin-left: auto;
        margin-right: auto;
    }
    
    .tutorial-thumbnail {
        height: auto;
        object-fit: cover;
    }
    
    .game-thumbnail {
        height: auto;
        object-fit: cover;
    }
    
    /* About Section Small Mobile */
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 12px; /* Reduced from 16px */
    }
    
    .about-text {
        text-align: left;
    }
    
    .about-greeting {
        font-size: 1.2rem; /* Reduced from 1.4rem */
        text-align: center;
        margin-bottom: 6px; /* Reduced from 8px */
    }
    
    .about-description {
        font-size: 0.9rem; /* Reduced from 1rem */
        margin-bottom: 10px; /* Reduced from 14px */
    }
    
    .companies-title {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .companies-list li {
        font-size: 0.85rem;
        padding: 2px 0;
    }
    
    .about-pic {
        width: 80px;
        height: 80px;
    }
    
    /* Necrozone Overlay Small Mobile */
    .necrozone-overlay .project-content {
        position: absolute;
        bottom: 20px;
        left: 15px;
        right: 15px;
        background: none;
        padding: 0;
        margin: 0;
    }
    
    .necrozone-overlay .project-links {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
    
    .necrozone-overlay .btn {
        min-width: 100px;
        max-width: 140px;
        font-size: clamp(9px, 2.5vw, 11px);
        padding: clamp(5px, 1.5vw, 8px) clamp(8px, 2vw, 10px);
    }
    
    .necrozone-overlay .project-image {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    /* Gallery Mobile Responsiveness */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 120px;
    }
}

@media (max-width: 360px) {
    /* Steam Button Small */
    .btn-steam {
        font-size: clamp(10px, 1.8vw, 12px);
        width: clamp(120px, 20vw, 160px);
        max-width: 160px;
        padding: clamp(6px, 1vw, 8px) clamp(10px, 2vw, 14px);
        gap: clamp(4px, 0.8vw, 6px);
    }
    
    /* App Store and Google Play Buttons Small */
    .btn-appstore,
    .btn-playstore {
        font-size: clamp(7px, 1vw, 9px);
        width: 60px;
        padding: clamp(4px, 0.8vw, 6px) clamp(6px, 1.2vw, 8px);
        gap: clamp(3px, 0.5vw, 5px);
    }
    
    .btn-text-main {
        font-size: clamp(7px, 1vw, 9px);
    }
    
    .btn-text-sub {
        font-size: clamp(6px, 0.8vw, 8px);
    }
}
