/**
 * Shared Styles for Disney Doorables Collection
 * Used by index.html and identifier.html
 */

/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== Header Styles ===== */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* ===== Button Styles ===== */
.header-button {
    display: inline-block;
    padding: 12px 30px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: none;
}

.header-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.view-button {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-button:hover {
    background: #667eea;
    color: white;
}

.view-button.active {
    background: #667eea;
    color: white;
}

/* ===== Character Card Styles ===== */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
    transition: gap 0.3s ease;
}

.characters-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 16px;
}

.characters-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 30px;
}

.character-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 15px;
    padding-bottom: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.character-card.compact {
    padding: 12px;
    padding-bottom: 0;
}

.character-card.large {
    padding: 22.5px;
}

.character-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    padding: 10px;
}

.character-card.compact .character-image {
    height: 120px;
}

.character-card.large .character-image {
    height: 225px;
}

.character-info {
    text-align: center;
    width: 100%;
    padding-bottom: 15px;
}

.character-card.compact .character-info {
    padding-bottom: 12px;
}

.character-card.large .character-info {
    padding-bottom: 22.5px;
}

.character-name {
    font-size: 0.95em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.character-name-link {
    font-size: 0.95em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
    line-height: 1.3;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.character-name-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.character-card.compact .character-name,
.character-card.compact .character-name-link {
    font-size: 0.76em;
}

.character-card.large .character-name,
.character-card.large .character-name-link {
    font-size: 1.425em;
}

.character-rarity {
    font-size: 0.85em;
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    display: inline-block;
    margin-top: 5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.character-card.compact .character-rarity {
    font-size: 0.68em;
    padding: 3.2px 6.4px;
    margin-bottom: 12px;
}

.character-card.large .character-rarity {
    font-size: 1.275em;
    padding: 6px 12px;
}

.character-series {
    font-size: 0.85em;
    color: #444;
    margin-top: 5px;
    font-style: italic;
    text-align: center;
    font-weight: 600;
}

.character-series-link {
    font-size: 0.85em;
    color: #667eea;
    margin-top: 5px;
    font-style: italic;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.character-series-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.character-card.compact .character-series,
.character-card.compact .character-series-link {
    font-size: 0.68em;
}

.character-card.large .character-series,
.character-card.large .character-series-link {
    font-size: 1.275em;
}

/* ===== Similarity Score Styles ===== */
.similarity-score {
    font-size: 0.9em;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    margin: 8px 0;
    display: inline-block;
    text-align: center;
}

.similarity-score.very-high-confidence {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.similarity-score.high-confidence {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.similarity-score.medium-confidence {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.similarity-score.low-confidence {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== Rarity Bar Styles ===== */
.rarity-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    width: 100%;
}

.rarity-bar.rarity-common {
    background: #c3cfe2;
}

.rarity-bar.rarity-rare {
    background: rgb(185, 210, 90);
}

.rarity-bar.rarity-super-rare {
    background: rgb(80, 130, 160);
}

.rarity-bar.rarity-ultra-rare {
    background: rgb(80, 130, 160);
}

.rarity-bar.rarity-special-edition {
    background: rgb(150, 30, 120);
}

.rarity-bar.rarity-limited-edition {
    background: rgb(250, 250, 110);
}

.rarity-bar.rarity-exclusive {
    background: rgb(105, 70, 185);
}

.rarity-bar.rarity-bonus {
    background: rgb(255, 0, 0);
}

/* ===== Modal/Lightbox Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    cursor: pointer;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    padding-bottom: 0;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    cursor: default;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-rarity-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    width: 100%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #764ba2;
}

.modal-character-image {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 30px;
    background: #f5f7fa;
    padding: 30px;
    flex-shrink: 0;
}

.modal-character-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.2;
    flex-shrink: 0;
}

.modal-character-name-link {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.2;
    flex-shrink: 0;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.modal-character-name-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.modal-character-rarity {
    font-size: 1.5em;
    text-align: center;
    padding: 12px 30px;
    border-radius: 25px;
    display: inline-block;
    margin: 0 auto;
    width: 100%;
    font-weight: 600;
    flex-shrink: 0;
}

.modal-character-series {
    font-size: 1.1em;
    color: #667eea;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 20px;
    font-weight: 500;
    flex-shrink: 0;
}

.modal-character-series-link {
    font-size: 1.1em;
    color: #667eea;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 20px;
    font-weight: 500;
    flex-shrink: 0;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.modal-character-series-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none;
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.5em;
    padding: 50px;
}

.loading-overlay {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-overlay > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-overlay p {
    font-size: 1.2em;
    margin-top: 10px;
    color: #333;
}

@media (max-width: 768px) {
    .loading-overlay {
        padding: 40px 20px;
        min-height: 300px;
        margin-bottom: 10px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }
    
    .loading-overlay p {
        font-size: 1.1em;
    }
}

.error {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

/* ===== Back to Top Button ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#back-to-top.show {
    display: flex;
}

/* ===== Grid Size Toggle ===== */
.grid-size-toggle {
    display: flex;
    gap: 4px;
}

.grid-size-btn {
    background: transparent;
    border: 2px solid #667eea;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #667eea;
    font-weight: 500;
}

.grid-size-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.grid-size-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .modal-content {
        max-width: 90%;
        padding: 30px;
    }

    .modal-character-image {
        max-height: 45vh;
        padding: 20px;
    }

    .modal-character-name,
    .modal-character-name-link {
        font-size: 2em;
    }

    .modal-character-rarity {
        font-size: 1.3em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1em;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }

    .characters-grid.compact {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }

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

    .character-card {
        padding: 10px;
    }

    .character-image {
        height: 110px;
        padding: 8px;
    }

    .character-card.compact .character-image {
        height: 90px;
        padding: 6px;
    }

    .character-card.large .character-image {
        height: 140px;
    }

    .character-name,
    .character-name-link {
        font-size: 0.85em;
    }

    .character-rarity {
        font-size: 0.75em;
        padding: 4px 8px;
    }

    .character-series,
    .character-series-link {
        font-size: 0.75em;
    }

    .modal-content {
        max-width: 95%;
        padding: 25px;
        max-height: 85vh;
    }

    .modal-character-image {
        max-height: 40vh;
        padding: 15px;
        margin-bottom: 20px;
    }

    .modal-character-name,
    .modal-character-name-link {
        font-size: 1.6em;
    }

    .modal-character-rarity {
        font-size: 1.1em;
        padding: 10px 20px;
    }

    .modal-character-series,
    .modal-character-series-link {
        font-size: 1em;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 15px;
        right: 15px;
    }

    #back-to-top {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6em;
    }

    header p {
        font-size: 0.9em;
    }

    .header-button {
        padding: 10px 20px;
        font-size: 1em;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 10px;
    }

    .modal-character-name,
    .modal-character-name-link {
        font-size: 1.4em;
    }
}

/* Made with Bob */
