/**
 * Générateur de Prénoms V2 - Styles
 * @version 2.0.0
 */

.prenoms-v2 {
    --girl-color: #E9D5FF;
    --girl-light: #F3E8FF;
    --boy-color: #90CAF9;
    --boy-light: #E3F2FD;
    --mixed-color: #B39DDB;
    --mixed-light: #EDE7F6;
    --primary: #9360F7;
}

/* Stats Bar */
.prenoms-stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #8B4B6B 100%);
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-item.highlight {
    padding: 0.5rem 1.5rem;
    background: rgba(255,255,255,0.2);
    border-radius: 2rem;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8125rem;
    opacity: 0.9;
}

/* Search Bar */
.search-bar-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .search-bar-premium {
        grid-template-columns: 1fr;
    }
    .prenoms-stats-bar {
        gap: 1rem;
        flex-wrap: wrap;
    }
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    outline: none;
}

.family-name-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.family-name-input label {
    font-size: 0.8125rem;
    color: #666;
}

.family-name-input input {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Filters */
.filters-premium {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    flex: 1;
    min-width: 140px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-buttons button {
    flex: 1;
    padding: 0.625rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-buttons button:hover {
    border-color: var(--primary);
}

.filter-buttons button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    box-sizing: border-box;
}

.reset-filters-btn {
    padding: 0.625rem 1rem;
    border: none;
    background: #ffebee;
    color: #c62828;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-count {
    font-size: 0.9375rem;
    color: #666;
}

.random-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9375rem;
}

/* Prénoms Grid */
.prenoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.prenom-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 2px solid #f0f0f0;
    transition: all 0.2s;
    cursor: default;
}

.prenom-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.prenom-card.girl {
    border-color: var(--girl-color);
    background: linear-gradient(180deg, var(--girl-light) 0%, white 30%);
}

.prenom-card.boy {
    border-color: var(--boy-color);
    background: linear-gradient(180deg, var(--boy-light) 0%, white 30%);
}

.prenom-card.mixed {
    border-color: var(--mixed-color);
    background: linear-gradient(180deg, var(--mixed-light) 0%, white 30%);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.prenom-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.mixed-badge {
    display: inline-block;
    background: var(--mixed-color);
    color: white;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.active {
    background: #fff3e0;
}

/* Card Stats */
.card-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.card-stats .stat {
    text-align: center;
    flex: 1;
}

.card-stats .stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.card-stats .stat-label {
    font-size: 0.6875rem;
    color: #888;
    text-transform: uppercase;
}

.card-stats .trend.up .stat-value { color: #4CAF50; }
.card-stats .trend.down .stat-value { color: #F44336; }

/* Card Details */
.card-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.detail-row.meaning {
    font-style: italic;
}

/* Full Name Preview */
.full-name-preview {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.preview-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.preview-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

/* Harmony Badge */
.harmony-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
}

.harmony-excellent { background: #d4edda; color: #155724; }
.harmony-good { background: #fff3cd; color: #856404; }
.harmony-ok { background: #ffe5d0; color: #854800; }
.harmony-check { background: #f8d7da; color: #721c24; }

/* Sparkline */
.sparkline-chart {
    display: flex;
    align-items: flex-end;
    height: 40px;
    gap: 2px;
    margin-bottom: 0.25rem;
}

.spark-bar {
    flex: 1;
    background: var(--primary);
    opacity: 0.6;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}

.sparkline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: #888;
}

/* See More Button */
.see-more-btn {
    width: 100%;
    padding: 0.625rem;
    border: none;
    background: #f5f5f5;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--primary);
    margin-top: 0.75rem;
}

.see-more-btn:hover {
    background: #e8e8e8;
}

/* Lazy Loading */
.lazy-load-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    margin: 1rem 0 2rem;
}

.load-more-info {
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 1rem;
}

.lazy-load-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.all-loaded {
    text-align: center;
    padding: 1.5rem;
    color: #4CAF50;
    font-weight: 500;
    margin-bottom: 2rem;
}

.card-fade-in {
    animation: cardFadeIn 0.3s ease-out;
}

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

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #fff3e0;
    border-radius: 1rem;
    margin: 2rem 0;
}

.error-state h3 {
    color: #e65100;
    margin: 0 0 1rem;
}

.error-state p {
    color: #666;
    margin-bottom: 1.5rem;
}

.error-state button {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

/* Favorites Section */
.favorites-section,
.comparison-section {
    background: #fff8e1;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    color: var(--primary);
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
}

.section-btn.danger {
    background: #ffebee;
    color: #c62828;
}

.favorites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: white;
    border-radius: 2rem;
    border: 2px solid #e0e0e0;
}

.fav-item.girl { border-color: var(--girl-color); }
.fav-item.boy { border-color: var(--boy-color); }
.fav-item.mixed { border-color: var(--mixed-color); }

.fav-name {
    font-weight: 600;
}

.fav-meaning {
    font-size: 0.8125rem;
    color: #888;
}

.remove-fav {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
}

.remove-fav:hover {
    opacity: 1;
}

/* Comparison Table */
.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.comparison-table th {
    background: #f5f5f5;
}

.comparison-table th.girl { background: var(--girl-light); }
.comparison-table th.boy { background: var(--boy-light); }
.comparison-table th.mixed { background: var(--mixed-light); }

/* Data Source */
.data-source {
    text-align: center;
    font-size: 0.8125rem;
    color: #888;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

.data-source a {
    color: var(--primary);
}

/* Modal */
.prenom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal-content {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content.girl {
    border-top: 4px solid var(--girl-color);
}

.modal-content.boy {
    border-top: 4px solid var(--boy-color);
}

.modal-content.mixed {
    border-top: 4px solid var(--mixed-color);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.modal-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2.5rem;
    color: var(--primary);
}

.modal-sex {
    font-size: 1rem;
    color: #666;
}

.modal-body {
    padding: 0 2rem 2rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
}

.modal-stat .value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-stat .label {
    font-size: 0.75rem;
    color: #666;
}

.modal-info {
    margin-bottom: 1.5rem;
}

.info-item {
    margin-bottom: 1rem;
}

.info-item strong {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.info-item p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.modal-chart {
    margin-bottom: 1.5rem;
}

.modal-chart h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--primary);
}

.detail-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 4px;
}

.chart-value {
    font-size: 0.5rem;
    color: white;
    padding-top: 2px;
    display: none;
}

.chart-bar:hover .chart-value {
    display: block;
}

.chart-label {
    font-size: 0.625rem;
    color: #888;
    margin-top: 4px;
}

.modal-fullname {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-fullname h4 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.modal-fullname .fullname {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 0 2rem 2rem;
}

.modal-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
}

.modal-btn.fav {
    background: var(--primary);
    color: white;
}

.modal-btn.share {
    background: #f5f5f5;
    color: #333;
}
