/* Mobile-First Responsive Styles */

/* Default (Mobile 320px+) - already styled in main.css */

/* Show mobile nav, hide desktop sidebar on mobile */
@media (max-width: 1023px) {
    .desktop-sidebar {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px){
    .fmg-user-notice h3 {
        font-size: 1rem !important;
    }
    .fmg-user-notice p {
        font-size: .8rem !important;
    }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    
    .auth-card.registration-card {
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .matching-container {
        touch-action: pan-x pan-y;
    }

    .match-dot {
        touch-action: none;
    }
    .auth-container {
        padding: 2rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 2rem 2rem 80px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
}

/* Desktop (1024px+) */
@media (max-width: 1024px) and (min-width: 769px) {

    .auth-card {
        padding: 1.5rem;
    }

    .matching-container {
        min-height: 500px;
    }

    .matching-item {
        min-width: 220px;
        padding: 20px 25px;
        font-size: 1.1rem;
    }
    .desktop-sidebar {
        display: block;
    }

    .mobile-nav {
        display: none;
    }

    .main-content {
        margin-left: 280px;
        padding: 2rem 3rem 2rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .quiz-container {
        max-width: 900px;
        margin: 0 auto;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .match-dot {
        min-width: 8px;
        min-height: 8px;
        margin: 0 -11px; /* Increase touch area */
        position: relative;
    }

    .match-dot::after {
        content: '';
        position: absolute;
        top: -15px;
        left: -15px;
        right: -15px;
        bottom: -15px;
        z-index: 1;
    }

    .matching-item {
        padding: 20px 25px;
        margin: 5px 0;
    }

    .left-item {
        padding-right: 50px;
    }

    .right-item {
        padding-left: 50px;
    }
    .btn,
    .nav-link,
    .mobile-nav .nav-item {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-page {
        padding: 1rem 0;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* Mobile Subjects Modal Styles */
.mobile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-modal.show {
    opacity: 1;
}

.mobile-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.mobile-modal.show .mobile-modal-content {
    transform: translateY(0);
}

.mobile-modal .modal-header {
    background: var(--primary-dark);
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-modal .modal-header h2 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.mobile-modal .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.mobile-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}


/* Subject Cards for Mobile */
.mobile-subjects-container {
    padding: 20px;
}

.mobile-subject-card {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: black
}

.mobile-subject-card:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.mobile-subject-card:active {
    transform: scale(0.98);
}

.mobile-subject-card .subject-icon {
    width: 55px;
    height: 55px;
    object-fit: contain;
    margin-right: 16px;

    padding: 10px;
}

.mobile-subject-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 24px;
}

.mobile-subject-info {
    flex: 1;
}

.mobile-subject-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.mobile-subject-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.mobile-subject-arrow {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.mobile-subject-card:hover .mobile-subject-arrow {
    opacity: 1;
}

/* Mobile Profile Modal Styles */
.mobile-profile-content {
    padding: 20px;
}

.mobile-profile-photo {
    text-align: center;
    margin-bottom: 20px;
}

.mobile-profile-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-blue);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mobile-profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.mobile-profile-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    color: white;
}

.mobile-profile-level {
    background: #667eea;
    color: white;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.mobile-profile-email,
.mobile-profile-phone {
    margin: 4px 0;
    color: white;
    font-size: 0.95rem;
}

/* Stats Grid */
.mobile-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mobile-stat-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.mobile-stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.mobile-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* PC Points Grid */
.mobile-pc-points {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #000000;
}

.mobile-pc-points h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    text-align: center;
}

.mobile-pc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mobile-pc-point {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Simple colorful points row */
.colorful-points-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.point-number {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blue-point { background: #0b7efb; color: white; }
.red-point { background: #fa0000; color: white; }
.gold-point { background: #FFD700; color: #333; }
.star-point { background: #4df020; color: white; }
.yellow-point { background: #6c6c6c; color: #333; }

/* Account Info */
.mobile-profile-account {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #1a1a2e;
}


.mobile-profile-account p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.mobile-profile-account strong {
    color: #333;
    margin-right: 8px;
}

/* Actions Buttons */
.mobile-profile-actions,
.mobile-profile-contactus {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-profile-contactus,
.mobile-profile-language {
margin-bottom: 10px;
}

.mobile-profile-actions .btn, 
.mobile-profile-contactus .btn,
.mobile-profile-language .btn {
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%
}

.mobile-profile-actions .btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.mobile-profile-actions .btn-secondary:active {
    background: #e9ecef;
}

.mobile-profile-actions .btn-danger {
    background: #f5576c;
    color: white;
}

.mobile-profile-actions .btn-danger:active {
    background: #d34558;
}

/* Scrollbar Styling for Mobile */
.mobile-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.mobile-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mobile-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mobile-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mobile-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .mobile-subject-info h3 {
        font-size: 1rem;
    }

    .mobile-subject-desc {
        font-size: 0.85rem;
    }

    .mobile-profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .mobile-pc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading state */
.mobile-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.mobile-loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

