@import url('/static/css/base.css');

/* =============================================================================
   MODELS PAGE
   ============================================================================= */

* {
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

.models-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: transparent !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    pointer-events: none;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: rgba(255, 255, 255, 1) !important;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content */
.models-main {
    min-height: calc(100vh - var(--header-height) - 80px);
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
}

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

.models-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
    animation: fadeInDown 0.6s ease forwards;
}

.models-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInDown 0.6s ease 0.1s forwards;
    opacity: 0;
}

/* Controls */
.models-controls {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.search-container {
    width: 100%;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: rgba(20, 20, 35, 0) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.search-input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.search-input:focus+.search-icon,
.search-container:focus-within .search-icon {
    color: var(--accent-blue);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.model-card {
    background-color: rgba(20, 20, 35, 0) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 220px;
}

.model-card:hover {
    border-color: var(--border-hover);
}

.model-card.hiding {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
}

.model-card.showing {
    animation: fadeInUp 0.4s ease forwards;
}

.model-card-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.model-plan {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

/* Plan badge colors */
.plan-free {
    background-color: rgba(34, 197, 94, 0.2);
    color: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.3);
}

.plan-basic {
    background-color: rgba(37, 99, 235, 0.2);
    color: rgba(100, 150, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.4);
}

.plan-pro {
    background-color: rgba(255, 215, 0, 0.2);
    color: rgba(255, 230, 100, 0.9);
    border-color: rgba(255, 215, 0, 0.4);
}

/* Locked model card */
.model-card.locked {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.05);
}

.model-card.locked:hover {
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

.model-lock-icon {
    font-size: 0.9em;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.4);
}

.model-use-btn.locked {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed;
}

.model-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.model-card:hover .model-name {
    color: rgba(255, 255, 255, 1) !important;
}

.model-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6) !important;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.model-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.model-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.model-use-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-blue);
    background-color: var(--accent-blue) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    color: white !important;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.model-use-btn:hover {
    background-color: var(--accent-blue-hover) !important;
    border-color: var(--accent-blue-hover);
    color: white !important;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 24px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.no-results i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Category Cards - Provider Headers */
.model-card.category {
    background: transparent;
    border: none;
    grid-column: 1 / -1;
    margin-top: 40px;
    margin-bottom: 16px;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

.model-card.category:first-child {
    margin-top: 0;
}

.model-card.category:hover {
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.model-card.category .model-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: -0.5px;
    text-align: left;
}

/* Tablet */
@media (max-width: 1024px) {
    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-actions {
        gap: 8px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .user-avatar-small {
        width: 28px;
        height: 28px;
    }

    .search-container {
        max-width: 100%;
    }

    .models-container {
        padding: 0 12px;
    }

    .models-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        min-width: 0;
        width: 100%;
    }

    .model-card {
        padding: 10px;
        aspect-ratio: 1 / 1;
        max-height: none;
        min-height: 180px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .model-card-header {
        margin-bottom: 6px;
    }

    .model-plan {
        padding: 3px 6px;
        font-size: 0.6rem;
    }

    .model-name {
        font-size: 0.85rem;
        line-height: 1.2;
        margin-bottom: 4px;
        flex-shrink: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .model-desc {
        font-size: 0.65rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 6px;
        flex: 1;
        line-height: 1.3;
    }

    .model-footer {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 6px;
    }

    .model-id {
        font-size: 0.55rem;
    }

    .model-use-btn {
        padding: 5px 8px;
        font-size: 0.65rem;
        width: 100%;
        text-align: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .models-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }

    .model-card {
        padding: 8px;
        min-height: 160px;
        min-width: 0;
        width: 100%;
    }

    .model-name {
        font-size: 0.75rem;
    }

    .model-desc {
        font-size: 0.6rem;
        -webkit-line-clamp: 2;
    }

    .model-plan {
        font-size: 0.55rem;
        padding: 2px 5px;
    }

    .model-id {
        font-size: 0.5rem;
    }

    .model-use-btn {
        font-size: 0.6rem;
        padding: 4px 6px;
    }
}

/* Sign In Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: rgba(15, 15, 25, 0) !important;
    backdrop-filter: blur(60px) !important;
    -webkit-backdrop-filter: blur(60px) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 10001;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.btn-google-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-google-signin:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9) !important;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.tos-checkbox {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(25, 25, 40, 0) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    transition: all 0.2s;
    color: transparent;
    font-size: 0.7rem;
}

.checkbox-label input:checked+.checkmark {
    background-color: var(--accent-blue) !important;
    border-color: rgba(59, 130, 246, 0.4);
    color: white;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.checkbox-label.error .checkmark {
    animation: shake 0.5s ease;
    border-color: rgba(239, 68, 68, 0.7);
}

.checkbox-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.tos-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tos-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}