/* Shared Logo Styles - Used by both public decals page and admin logos page */

/* Logos Grid */
.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.logo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.logos-grid.brands-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Admin-specific: Primary logo styling */
.admin-container .logo-card.primary-logo {
    border: 2px solid var(--accent-primary);
}

.logo-image {
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.logo-image .no-image-placeholder {
    width: 60px;
    height: 60px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.logo-info {
    flex: 1;
    margin-bottom: 15px;
}

.logo-info h3,
.logo-brand-name {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: var(--text-primary);
    font-weight: 600;
}

.logo-info h3.logo-brand-name {
    cursor: pointer;
    transition: color 0.2s ease;
}

.logo-info h3.logo-brand-name:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.logo-info h3 .brand-name-link,
.logo-info h3 .team-name-link {
    cursor: pointer;
    transition: color 0.2s ease;
}

.logo-info h3 .brand-name-link:hover,
.logo-info h3 .team-name-link:hover {
    color: var(--accent-primary);
    text-decoration: underline !important;
}

.logo-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.logo-variant {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    color: var(--text-secondary);
    font-weight: 500;
}

.logo-meta {
    margin: 5px 0;
    font-size: 0.85em;
    color: var(--text-tertiary);
}

.logo-info p.logo-years,
.logo-years {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 1em;
    margin-top: 8px;
}

.logo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.logo-card:hover .logo-actions {
    opacity: 1;
}

.btn-download {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logo-card:hover .btn-download {
    background: var(--accent-primary);
    color: white;
}

.logo-card:hover .btn-download:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-download:active {
    transform: translateY(0);
}

/* Team Season Card - Compact 2-column layout */
.logo-card.team-season-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.team-season-card .series-logo-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-season-card .series-logo-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.team-season-card .season-info-wrapper {
    flex: 1;
    min-width: 0;
}

.team-season-card .logo-info {
    margin-bottom: 0;
}

.team-season-card .logo-info p {
    margin: 0 0 4px 0;
}

.team-season-card .logo-info p:first-child {
    font-weight: 600;
    font-size: 0.95em;
}

.team-season-card .logo-info .season-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.team-season-card .logo-info .logo-variant {
    font-size: 0.9em;
    margin: 0;
}

.team-season-card .logo-info .logo-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

.team-season-card .logo-info .logo-meta::before {
    content: "•";
    margin-right: 8px;
    color: var(--text-tertiary);
}

.team-season-card .logo-actions {
    flex-shrink: 0;
    opacity: 1;
}

/* Brand Card Specific Styles */
.brand-card {
    min-height: 120px;
}

.brand-card .logo-image {
    max-height: 120px;
    padding: 15px;
    margin-bottom: 10px;
}

.brand-card .logo-image img {
    max-height: 80px;
}

.brand-info {
    flex: 1;
    margin-bottom: 15px;
}

/* Center brand name (always, since we now always show the name) */
.brand-card .brand-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Add min-height when no logo */
.brand-card:not(:has(.logo-image)) .brand-info {
    min-height: 100px;
}

.brand-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.brand-card:not(:has(.logo-image)) .brand-info h3 {
    margin: 0 0 10px 0;
}

.brand-info h3 a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.brand-info h3 a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.brand-website {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.brand-website a {
    color: var(--accent-primary);
    text-decoration: none;
}

.brand-website a:hover {
    text-decoration: underline;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.brand-card:hover .card-actions,
.team-card:hover .card-actions {
    opacity: 1;
}

.card-actions .btn-sm {
    flex: 1;
    min-width: fit-content;
    text-align: center;
}

/* Team Card Specific Styles */
.team-card {
    min-height: 120px;
}

.team-card .logo-image {
    max-height: 120px;
    padding: 15px;
    margin-bottom: 10px;
}

.team-card .logo-image img {
    max-height: 80px;
}

.team-info {
    flex: 1;
    margin-bottom: 15px;
}

/* Center team name when no logo */
.team-card .team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.team-card:not(:has(.logo-image)) .team-info {
    min-height: 100px;
}

.team-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.team-card:not(:has(.logo-image)) .team-info h3 {
    margin: 0 0 10px 0;
}

.team-info h3 a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.team-info h3 a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.team-series, .team-founded {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Series Card Specific Styles */
.series-card {
    min-height: 120px;
}

.series-card .logo-image {
    max-height: 120px;
    padding: 15px;
    margin-bottom: 10px;
}

.series-card .logo-image img {
    max-height: 80px;
}

.series-info {
    flex: 1;
    margin-bottom: 15px;
}

/* Center series name when no logo */
.series-card .series-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.series-card:not(:has(.logo-image)) .series-info {
    min-height: 100px;
}

.series-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.series-card:not(:has(.logo-image)) .series-info h3 {
    margin: 0 0 10px 0;
}

.series-info h3 a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.series-info h3 a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.series-category, .series-tier {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.series-card:hover .card-actions {
    opacity: 1;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 40px;
}

.teams-grid-container, .series-grid-container {
    display: none;
}

.public-grid.team-seasons-public-grid, .public-grid.team-carmodels-public-grid {
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.public-header {
    text-align: center;
    padding: 40px 20px 20px;
}

.public-header h1 {
    margin-bottom: 30px;
}

.public-logo-large {
    margin-bottom: 20px;
}

.public-logo-large img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
}

.public-details-container {
    max-width: 800px;
    margin: 0 auto 30px;
}

.public-details-box {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.public-details-box h2 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.public-details-fields {
    display: flex;
    gap: 30px;
}

.public-details-field {
    flex: 1;
}

.public-details-field label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.public-details-field-value {
    padding: 10px;
    background: var(--hover-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.public-section {
    max-width: 1200px;
    margin: 0 auto 40px;
}

.public-section h2 {
    margin-bottom: 20px;
    padding: 0 20px;
}

.public-section-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.public-grid {
    padding: 0 20px;
}

.public-grid.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.public-loading,
.public-empty {
    text-align: center;
    color: var(--text-secondary);
}

.public-loading {
    grid-column: 1/-1;
}

.public-empty {
    display: none;
    padding: 20px;
}

/* Car Model Card & Sponsor Card - Info and actions side by side */
.team-car-model-card,
.team-sponsor-card {
    display: flex;
    flex-direction: column;
}

.team-car-model-card .logo-info,
.team-sponsor-card .logo-info {
    margin-bottom: 0;
    flex: 1;
}

.team-car-model-card .logo-info + .logo-actions,
.team-sponsor-card .logo-info + .logo-actions {
    margin-top: 0;
}

/* Wrapper to put info and actions side by side */
.team-car-model-card .info-actions-wrapper,
.team-sponsor-card .info-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Admin-specific: Badges and buttons */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-set-primary {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-set-primary:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

/* Decals Page Specific Styles */
.decals-header {
    text-align: center;
    padding: 40px 20px 20px 20px;
}

.decals-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.decals-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

.loading-indicator::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin-left: 10px;
    animation: spinner 0.8s linear infinite;
}

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

/* No Data Message */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    .decals-header h1 {
        font-size: 2rem;
    }

    .decals-subtitle {
        font-size: 1rem;
    }

    .logo-card {
        padding: 12px;
    }

    .logo-image {
        min-height: 120px;
        padding: 15px;
    }

    .logo-image img {
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    .logos-grid {
        grid-template-columns: 1fr;
    }

    .decals-header h1 {
        font-size: 1.75rem;
    }
}

/* Logo Modal Styles */
.logo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2.5vh 2.5vw;
}

.logo-modal-overlay.active {
    display: flex;
}

.logo-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    width: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.logo-modal-content.primary-logo {
    border: 2px solid var(--accent-primary);
}

.logo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.logo-modal-close:hover {
    background: var(--accent-primary);
    color: white;
    transform: rotate(90deg);
}

.logo-modal-image {
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-modal-image img {
    max-width: 1000px;
    max-height: 800px;
    object-fit: contain;
    display: block;
}

/* Fixed size for SVG files */
.logo-modal-image-svg {
    width: 800px;
    height: 800px;
    max-width: calc(95vw - 60px);
    max-height: calc(95vh - 60px - 200px);
}

.logo-modal-image-svg img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.logo-modal-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logo-modal-info h3 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-primary);
    font-weight: 600;
}

.logo-modal-info p {
    margin: 0;
    font-size: 1em;
    color: var(--text-secondary);
}

.logo-modal-variant {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 500;
}

.logo-modal-meta {
    font-size: 0.95em;
    color: var(--text-tertiary);
}

.logo-modal-years {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 1.1em;
}

.logo-modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.logo-modal-actions .btn-download {
    flex: 1;
    padding: 12px 24px;
    font-size: 1em;
    background: var(--accent-primary);
    color: white;
}

.logo-modal-actions .btn-download:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.logo-clickable {
    transition: opacity 0.2s ease;
}

.logo-clickable:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .logo-modal-content {
        padding: 20px;
        max-width: 95vw;
        max-height: 95vh;
    }

    .logo-modal-image {
        padding: 20px;
    }

    .logo-modal-image img {
        max-width: calc(95vw - 40px - 40px);
        max-height: calc(95vh - 40px - 180px);
    }

    .logo-modal-image-svg {
        width: calc(95vw - 40px);
        height: calc(95vw - 40px);
        max-height: calc(95vh - 40px - 180px);
    }

    .logo-modal-info h3 {
        font-size: 1.3em;
    }

    .logo-modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}
