/* Imagier View - Styles */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--secondary);
    text-decoration: none;
}

.header h1 {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 0;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--secondary);
    border-color: var(--primary);
}

#btn-print {
    font-size: 1.6rem;
    padding: 0.5rem 1rem;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* Loading */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Words grid */
.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Word card */
.word-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.word-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--secondary);
}

.word-card-content {
    padding: 1rem;
    text-align: center;
}

.word-card-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.25rem 0;
}

.word-card-definition {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.word-card-audio {
    margin-top: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.word-card-audio svg,
.word-card-audio i[data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.word-card-audio:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Zoom modal */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-modal.hidden {
    display: none;
}

.zoom-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.zoom-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 90vw;
    max-height: 90vh;
}

.zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.zoom-prev,
.zoom-next {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 3rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.zoom-prev:hover,
.zoom-next:hover {
    background: rgba(255,255,255,0.3);
}

.zoom-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 500px;
    text-align: center;
}

.zoom-card img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--secondary);
}

.zoom-text {
    padding: 1.5rem;
}

.zoom-text h2 {
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
}

.zoom-text p {
    color: var(--text-light);
    margin: 0;
    font-size: 1.1rem;
}

.zoom-audio-btn {
    margin: 0 0 1rem 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zoom-audio-btn svg,
.zoom-audio-btn i[data-lucide] {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Top toolbar btn-icon avec Lucide */
.btn-icon svg,
.btn-icon i[data-lucide] {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
    vertical-align: middle;
}

.zoom-audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Fullscreen */
.fullscreen .header {
    display: none;
}

.fullscreen .main-content {
    padding: 1rem;
}

.fullscreen .words-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .word-card-text {
        font-size: 1rem;
    }

    .zoom-prev,
    .zoom-next {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .zoom-card {
        max-width: 85vw;
    }
}

/* Modal choix modèle impression */
.print-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-modal.hidden {
    display: none;
}

.print-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.print-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.print-modal-content h3 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.print-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.print-options:last-of-type {
    border-bottom: none;
}

.print-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.print-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.print-modal-actions button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary {
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-primary {
    background: var(--primary);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}
