/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--panel) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--muted);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
}

.upload-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Game Header */
.game-header {
    display: flex;
    align-items: center;
    background: var(--panel);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    gap: 2rem;
}

.game-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.game-image-placeholder {
    width: 150px;
    height: 150px;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    text-align: center;
    padding: 1rem;
}

.game-image-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.game-content {
    flex-grow: 1;
}

.game-title {
    color: var(--muted);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.game-meta {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

.game-languages {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid #333;
    object-fit: cover;
}

/* Game Info */
.game-info {
    background: var(--panel);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.game-info h3 {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.info-table th,
.info-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

.info-table th {
    font-weight: bold;
    width: 30%;
    color: var(--muted);
    text-align: left;
}

/* Description Spoiler */
.description-spoiler {
    margin-top: 1.5rem;
}

.description-spoiler summary {
    cursor: pointer;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-weight: bold;
    list-style: none;
    transition: all 0.3s ease;
}

.description-spoiler summary:hover {
    background: #222;
}

.description-spoiler summary::-webkit-details-marker {
    display: none;
}

.description-spoiler summary::after {
    content: "▼";
    float: right;
    transition: transform 0.3s;
}

.description-spoiler[open] summary::after {
    transform: rotate(180deg);
}

.description-content {
    padding: 1rem;
    background: #0c0c0c;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Codes List */
.codes-list {
    margin-top: 2rem;
}

.section-title {
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Section Spoiler */
.section-spoiler {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.section-spoiler summary {
    cursor: pointer;
    padding: 1.5rem;
    background: #1a1a1a;
    color: var(--muted);
    font-weight: bold;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-spoiler summary::-webkit-details-marker {
    display: none;
}

.section-spoiler summary::after {
    content: "▼";
    transition: transform 0.3s;
}

.section-spoiler[open] summary::after {
    transform: rotate(180deg);
}

.section-summary {
    flex-grow: 1;
}

.section-description {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: normal;
}

.section-meta {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-content {
    padding: 1rem;
}

/* Code Item */
.code-item {
    background: var(--panel);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.code-item:hover {
    transform: translateX(5px);
    border-color: var(--muted);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.code-item.has-checkbox {
    padding-left: 3rem;
}

.code-checkbox {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.code-header {
    margin-bottom: 1rem;
}

.code-title {
    color: var(--muted);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.code-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-block {
    background: #0c0c0c;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-x: auto;
}

.notes-section {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.notes-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.notes-content {
    line-height: 1.5;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* No Codes Message */
.no-codes {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 2rem 0;
}

.no-codes h3 {
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-codes p {
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Bulk Actions */
.bulk-actions {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: none;
}

.bulk-actions.show {
    display: block;
}

.bulk-actions p {
    margin-bottom: 1rem;
    color: var(--muted);
}

/* Back Section */
.back-section {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Code Entry in Modal */
.code-entry {
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    background: #1a1a1a;
}

.code-entry:not(:first-child) {
    margin-top: 1.5rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .upload-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .upload-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .game-image,
    .game-image-placeholder {
        width: 120px;
        height: 120px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .info-table th {
        width: 40%;
    }
    
    .section-spoiler summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .section-actions .btn {
        flex: 1;
    }
    
    .code-item.has-checkbox {
        padding-left: 1.5rem;
    }
    
    .code-checkbox {
        position: static;
        margin-bottom: 1rem;
        display: block;
    }
    
    .code-actions {
        flex-direction: column;
    }
    
    .code-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .game-info {
        padding: 1rem;
    }
    
    .info-table th,
    .info-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .code-item {
        padding: 1rem;
    }
    
    .code-title {
        font-size: 1.2rem;
    }
    
    .code-block {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

/* Stile per il link del caricatore */
.code-meta a {
    color: var(--muted);
    text-decoration: none;
    font-weight: bold;
}

.code-meta a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Stili per le sottosezioni */
.subsection-spoiler {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    margin: 1rem 0 1rem 1rem;
    overflow: hidden;
}

.subsection-spoiler summary {
    cursor: pointer;
    padding: 1rem;
    background: #222;
    color: var(--muted);
    font-weight: bold;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.subsection-spoiler summary::-webkit-details-marker {
    display: none;
}

.subsection-spoiler summary::after {
    content: "▼";
    transition: transform 0.3s;
}

.subsection-spoiler[open] summary::after {
    transform: rotate(180deg);
}

.subsection-summary {
    flex-grow: 1;
}

.subsection-description {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: normal;
}

.subsection-meta {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.subsection-actions {
    display: flex;
    gap: 0.5rem;
}

.subsection-content {
    padding: 1rem;
}

/* Responsive per sottosezioni */
@media (max-width: 768px) {
    .subsection-spoiler {
        margin: 1rem 0;
    }
    
    .subsection-spoiler summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .subsection-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .subsection-actions .btn {
        flex: 1;
    }
}