/* Interactive Belt Display Styles */
.interactive-belt-display {
    padding: 2rem 0;
    overflow: hidden;
}

.belt-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* Reduced gap to fit more cards in a row with increased card width */
    margin: 0 auto;
    max-width: 1300px; /* Increased to accommodate wider cards */
    padding: 0 5px; /* Add some padding to avoid edge touching on small screens */
}

.belt-card {
    background: linear-gradient(145deg, #222, #191919);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 6px 6px rgba(0, 0, 0, 0.3), inset 0 -5px 10px rgba(0, 0, 0, 0.2);
    width: 280px; /* Increased from 260px to give more space for text */
    height: 360px;
    perspective: 1000px;
    position: relative;
    margin-bottom: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Glowing effect on hover */
.belt-card::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: 16px;
    background: linear-gradient(45deg, transparent, transparent, #c41e3a, transparent, transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.belt-card:hover::before {
    opacity: 1;
}

/* Style for card hover */
.belt-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 10px 10px rgba(0, 0, 0, 0.3), inset 0 -5px 12px rgba(0, 0, 0, 0.3);
}

/* "Click me" button - ALWAYS visible now */
.belt-card .click-button {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(196, 30, 58, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
    z-index: 10; /* Ensure it's above other content */
    width: 70%;
    cursor: pointer;
}

.belt-card:hover .click-button {
    transform: translateX(-50%) translateY(-5px);
    background-color: rgba(216, 30, 58, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.belt-card.flipped .click-button {
    opacity: 0;
    pointer-events: none;
}

.belt-front, .belt-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
}

.belt-front {
    justify-content: center;
    background: linear-gradient(145deg, #222, #191919);
    z-index: 2;
    transform: rotateY(0deg);
}

.belt-back {
    background: linear-gradient(145deg, #222, #191919);
    transform: rotateY(180deg);
    overflow-y: auto;
    text-align: left;
}

.belt-card.flipped .belt-front {
    transform: rotateY(180deg);
}

.belt-card.flipped .belt-back {
    transform: rotateY(0deg);
    z-index: 3;
}

.belt-icon {
    width: 220px;
    height: auto;
    margin-bottom: 20px;
    transform-origin: center;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}

.belt-card:hover .belt-icon {
    transform: scale(1.08) translateY(-5px);
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.7));
}

.belt-front h3 {
    margin: 10px 0 5px;
    font-size: 1.25rem; /* Larger size for desktop */
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0px;
    white-space: nowrap; /* Keep title on single line */
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    max-width: 100%;
    /* Scale text to fit container */
    transform-origin: center center;
    transform: scale(0.95);
}

.belt-japanese {
    color: #c0c0c0;
    font-style: italic;
    margin-top: 0;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.belt-back h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid #444;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.belt-back p {
    color: #e0e0e0;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.belt-skills {
    width: 100%;
}

.belt-skills h5 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.belt-skills ul {
    padding-left: 20px;
    margin: 0;
}

.belt-skills li {
    color: #e0e0e0;
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Belt specific colors for subtle backgrounds or accents */
.belt-card[data-belt="white"] {
    border-top: 5px solid #f5f5f5;
}

.belt-card[data-belt="yellow"] {
    border-top: 5px solid #ffd700;
}

.belt-card[data-belt="orange"] {
    border-top: 5px solid #ff8c00;
}

.belt-card[data-belt="green"] {
    border-top: 5px solid #228b22;
}

.belt-card[data-belt="blue"] {
    border-top: 5px solid #1e90ff;
}

.belt-card[data-belt="purple"] {
    border-top: 5px solid #800080;
}

.belt-card[data-belt="brown1"] {
    border-top: 5px solid #8b4513;
}

.belt-card[data-belt="brown2"] {
    border-top: 5px solid #7a3b0c;
}

.belt-card[data-belt="brown3"] {
    border-top: 5px solid #663005;
}

.belt-card[data-belt="black"] {
    border-top: 5px solid #000000;
}

/* Scrollbar for the back of the cards */
.belt-back::-webkit-scrollbar {
    width: 6px;
}

.belt-back::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

.belt-back::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.belt-back::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .belt-container {
        gap: 15px;
    }
    
    .belt-card {
        width: calc(50% - 15px);
        height: 320px;
    }
    
    .belt-icon {
        width: 150px;
    }
    
    .belt-front h3 {
        font-size: 1rem; /* Reduced from 1.2rem */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .belt-japanese {
        font-size: 0.85rem; /* Reduced from 0.9rem */
    }
}

@media (max-width: 576px) {
    .belt-container {
        gap: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .belt-card {
        width: calc(50% - 15px); /* Always show two cards per row */
        min-width: 150px; /* Minimum width to ensure readability */
        max-width: 220px; /* Maximum width to maintain good proportions */
        height: 320px;
    }
    
    .belt-front h3 {
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 5px;
    }
}

/* Mobile Optimizations for Belt Display */
@media (max-width: 768px) {
    .belt-container {
        gap: 15px;
    }
    
    .belt-card {
        width: 240px; /* Increased from 220px to give more space */
        height: 320px;
        margin-bottom: 15px;
    }
    
    .belt-svg {
        max-width: 90%;
        max-height: 90px;
    }
    
    .belt-title {
        font-size: 1.2rem; /* Reduced from 1.35rem */
        margin: 0.5rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .belt-description {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 0 0.75rem;
        max-height: 70px;
    }
    
    .card-front .learn-more {
        bottom: 15px;
        font-size: 0.85rem;
        padding: 5px 15px;
    }
    
    .card-back .belt-info {
        padding: 0.75rem;
    }
    
    .card-back .belt-info h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .card-back .belt-info p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 575.98px) {
    .belt-container {
        gap: 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .belt-card {
        /* Two cards per row on mobile */
        width: calc(50% - 8px);
        min-width: 140px; /* Minimum width to ensure readability */
        max-width: 200px; /* Maximum width to maintain good proportions */
        height: 280px;
        margin-bottom: 10px;
    }
    
    .belt-svg {
        max-width: 85%;
        max-height: 70px;
    }
    
    .belt-title {
        font-size: 1rem; /* Reduced from 1.15rem */
        margin: 0.35rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 0.25rem;
        max-width: 100%;
    }
    
    .belt-description {
        font-size: 0.8rem;
        line-height: 1.3;
        padding: 0 0.5rem;
        max-height: 60px;
    }
    
    .belt-card .click-button {
        bottom: 12px;
        font-size: 0.7rem;
        padding: 4px 10px;
        width: 80%;
    }
    
    .belt-back {
        padding: 15px 10px;
        overflow-y: auto;
    }
    
    .belt-back h4 {
        font-size: 1.2rem;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .belt-back p {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .belt-skills h5 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .belt-skills li {
        font-size: 0.7rem;
        margin-bottom: 5px;
        line-height: 1.3;
    }
    
    .card-front .learn-more {
        bottom: 12px;
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    .card-back .belt-info {
        padding: 0.5rem;
    }
    
    .card-back .belt-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }
    
    .card-back .belt-info p {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 0.35rem;
    }
    
    .card-back .close-info {
        font-size: 0.75rem;
        padding: 3px 10px;
        bottom: 10px;
    }
}

/* Super small devices (small portrait phones) */
@media (max-width: 359.98px) {
    .belt-container {
        gap: 6px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .belt-card {
        /* Two cards per row on all mobile devices */
        width: calc(50% - 5px);
        min-width: 130px; /* Minimum width to ensure readability */
        max-width: 170px; /* Maximum width to maintain good proportions */
        height: 240px;
    }
    
    .belt-svg {
        max-height: 60px;
    }
    
    .belt-title {
        font-size: 0.9rem; /* Reduced from 1rem */
        margin: 0.25rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 0.2rem;
        max-width: 100%;
    }
    
    .belt-description {
        font-size: 0.7rem;
        line-height: 1.2;
        max-height: 50px;
    }
    
    .belt-card .click-button {
        bottom: 10px;
        font-size: 0.65rem;
        padding: 3px 8px;
        width: 85%;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .belt-back {
        padding: 12px 8px;
    }
    
    .belt-back h4 {
        font-size: 1rem;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    
    .belt-back p {
        font-size: 0.7rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .belt-skills h5 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .belt-skills li {
        font-size: 0.65rem;
        margin-bottom: 4px;
        line-height: 1.2;
    }
}
/* Small mobile devices -- make the button text smaller and fit on one line */
@media (max-width: 330px) {
    .belt-card .click-button {
        font-size: 0.55rem !important; /* Even smaller font */
        padding: 3px 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 90% !important;
        bottom: 10px !important;
        width: auto !important; /* Let it be the size of the content */
        min-width: 60% !important; /* But ensure it's not too small */
    }
    
    /* Make belt titles smaller to fit on one line */
    .belt-front h3 {
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        text-align: center !important;
        padding: 0 0.15rem !important;
    }
    
    /* Make belt Japanese text smaller */
    .belt-japanese {
        font-size: 0.75rem !important;
    }
}

/* Special rule for Greek language on mobile devices - prevent text cutoff */
@media (max-width: 576px) {
    html[lang="el"] .belt-front h3 {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        padding: 0 0.15rem !important;
        letter-spacing: -0.2px !important;
    }
}

/* Extra special rule for very small devices with Greek language */
@media (max-width: 359px) {
    html[lang="el"] .belt-front h3 {
        font-size: 0.65rem !important;
        letter-spacing: -0.3px !important;
        padding: 0 0.1rem !important;
    }
}

/* Small mobile devices -- make the button text smaller and fit on one line - additional fixes */
@media (max-width: 330px) {
    .belt-card .click-button {
        font-size: 0.55rem !important; /* Even smaller font */
        padding: 3px 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 90% !important;
        bottom: 10px !important;
        width: auto !important; /* Let it be the size of the content */
        min-width: 60% !important; /* But ensure it's not too small */
    }
    
    /* Make belt titles smaller to fit on one line */
    .belt-front h3 {
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        text-align: center !important;
        padding: 0 0.15rem !important;
    }
    
    /* Even smaller text for Greek language on very small devices */
    html[lang="el"] .belt-front h3 {
        font-size: 0.6rem !important;
        letter-spacing: -0.4px !important;
        padding: 0 0.05rem !important;
    }
    
    /* Make belt Japanese text smaller */
    .belt-japanese {
        font-size: 0.75rem !important;
    }
}
