/**
 * Styles pour la page Texture Packs
 * Version optimisée et séparée
 */

/* Grid des texture packs */
.texturepacks-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Carte horizontale de texture pack */
.texturepack-horizontal-card {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.9), rgba(10, 14, 39, 0.95));
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.texturepack-horizontal-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
    transform: translateY(-3px);
}

/* Logo à gauche */
.tp-logo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(0, 212, 255, 0.2);
}

.tp-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.tp-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    font-size: 48px;
}

/* Contenu au milieu */
.tp-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tp-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-icon {
    font-size: 28px;
    line-height: 1;
}

.tp-title {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tp-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-description {
    color: var(--text-gray);
    line-height: 1.6;
    font-size: 14px;
    margin: 5px 0;
}

.btn-more {
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: fit-content;
}

.btn-more:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-color);
}

/* Actions à droite */
.tp-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 220px;
}

.tp-version-selector label {
    display: block;
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 5px;
    font-weight: 600;
}

.version-dropdown {
    width: 100%;
    padding: 10px 12px;
    background: var(--dark-bg);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.version-dropdown:hover {
    border-color: var(--primary-color);
}

.version-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.btn-download {
    width: 100%;
    padding: 12px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.btn-curseforge {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 8px;
    color: #ffa500;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.btn-curseforge:hover {
    background: rgba(255, 165, 0, 0.1);
    border-color: #ffa500;
}

.texturepack-header {
    display: flex;
    gap: 20px;
    align-items: center;
}

.texturepack-icon {
    font-size: 50px;
    line-height: 1;
    flex-shrink: 0;
}

.texturepack-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
}

.texturepack-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-blue {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    border: 1px solid #3498db;
}

.tag-red {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.tag-purple {
    background: rgba(155, 89, 182, 0.3);
    color: #9b59b6;
    border: 1px solid #9b59b6;
}

.tag-orange {
    background: rgba(230, 126, 34, 0.3);
    color: #e67e22;
    border: 1px solid #e67e22;
}

.tag-green {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.tag-teal {
    background: rgba(22, 160, 133, 0.3);
    color: #16a085;
    border: 1px solid #16a085;
}

.texturepack-description {
    color: var(--text-gray);
    line-height: 1.6;
    flex-grow: 1;
}

.texturepack-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.btn-pack {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.btn-info {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-color);
}

/* Guide d'installation */
.installation-guide {
    max-width: 900px;
    margin: 0 auto;
}

.installation-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.step-content h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
}

.step-content p {
    color: var(--text-gray);
    line-height: 1.6;
}

.installation-warning {
    background: linear-gradient(145deg, rgba(255, 170, 0, 0.1), rgba(255, 100, 0, 0.1));
    border: 2px solid rgba(255, 170, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.warning-icon {
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}

.warning-content h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--warning-color);
    margin-bottom: 10px;
}

.warning-content p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Section OptiFine */
.optifine-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.optifine-content {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.9), rgba(10, 14, 39, 0.95));
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 50px 40px;
}

.optifine-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.optifine-content h3 {
    font-size: 32px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.optifine-content > p {
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 30px;
}

.optifine-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.feature-badge {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--success-color);
    font-weight: 600;
    font-size: 14px;
}

.btn-large {
    padding: 20px 50px;
    font-size: 20px;
}

/* Modal de téléchargement */
#downloadModal,
#packDetailsModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-download {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.98), rgba(10, 14, 39, 0.98));
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    width: 96vw;
    max-width: 2400px;
    max-height: 96vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    padding: 50px 60px 30px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.modal-header h2 {
    font-size: 40px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.modal-subtitle {
    color: var(--text-gray);
    font-size: 16px;
}

.modal-body {
    padding: 40px 60px 50px;
}

.versions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.version-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.version-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

.version-info h4 {
    color: var(--text-light);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.version-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.version-detail {
    color: var(--text-gray);
    font-size: 14px;
}

.version-detail strong {
    color: var(--primary-color);
}

.btn-download-version {
    padding: 12px 25px;
    background: var(--accent-gradient);
    color: var(--text-light);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-download-version:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

/* Image du texture pack */
.texturepack-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
    margin: -30px -30px 20px -30px;
}

.texturepack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer de la carte */
.texturepack-footer {
    padding: 15px 0;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    margin-bottom: 15px;
}

.texturepack-stats {
    display: flex;
    gap: 15px;
    color: var(--text-gray);
    font-size: 14px;
}

/* Modal de détails */
.modal-details {
    width: 90vw;
    max-width: 1400px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 40px 50px;
}

.pack-details-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    text-align: center;
}

.pack-details-icon {
    font-size: 60px;
    line-height: 1;
}

.pack-details-header h2 {
    font-size: 36px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.pack-main-image {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pack-main-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.pack-description {
    margin-bottom: 30px;
}

.pack-description h3 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.pack-description p {
    color: var(--text-gray);
    line-height: 1.9;
    margin-bottom: 15px;
    font-size: 17px;
}

/* Styles pour le contenu formaté */
.description-content {
    color: var(--text-gray);
    line-height: 1.9;
    font-size: 17px;
}

.description-content p {
    margin-bottom: 15px;
    font-size: 17px;
}

.description-content strong {
    color: var(--text-light);
    font-weight: 700;
}

.description-content em {
    font-style: italic;
}

.description-content u {
    text-decoration: underline;
}

.description-content h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 25px 0 15px 0;
    font-weight: 700;
}

.description-content ul,
.description-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.description-content ul li {
    list-style-type: disc;
    margin-bottom: 12px;
    color: var(--text-gray);
    font-size: 17px;
    line-height: 1.8;
}

.description-content ol li {
    list-style-type: decimal;
    margin-bottom: 12px;
    color: var(--text-gray);
    font-size: 17px;
    line-height: 1.8;
}

/* Support pour l'alignement de texte */
.description-content [style*="text-align: center"],
.description-content div[align="center"],
.description-content p[align="center"] {
    text-align: center;
}

.description-content [style*="text-align: left"],
.description-content div[align="left"],
.description-content p[align="left"] {
    text-align: left;
}

.description-content [style*="text-align: right"],
.description-content div[align="right"],
.description-content p[align="right"] {
    text-align: right;
}

.pack-gallery {
    margin-bottom: 30px;
}

.pack-gallery h3 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.gallery-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(0, 212, 255, 0.2);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.gallery-grid img.enlarged {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10001;
    max-width: 90vw;
    max-height: 90vh;
    height: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.pack-versions-summary {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.pack-versions-summary h3 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.pack-external-link {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .texturepack-horizontal-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .tp-logo {
        width: 100%;
        height: 200px;
    }

    .tp-actions {
        width: 100%;
        min-width: 0;
    }

    .texturepack-actions {
        flex-direction: column;
    }

    .optifine-features {
        grid-template-columns: 1fr;
    }

    .step-item {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin: 0 auto;
    }

    .installation-warning {
        flex-direction: column;
        text-align: center;
    }

    .warning-icon {
        margin: 0 auto;
    }

    .modal-download {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header, .modal-body {
        padding: 20px;
    }

    .version-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
