/* Profile Card */
.cards-container {
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    border: 1px solid rgba(130, 46, 245, 0.2);
}

.cards-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -8px rgba(130, 46, 245, 0.25);
}

.profile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
}

.profile-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-image {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--background-color);
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(130, 46, 245, 0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-image img.loaded {
    opacity: 1;
}

.profile-image::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border: 3px solid var(--background-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.profile-image.loaded::before {
    display: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--background-color);
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(130, 46, 245, 0.1);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(130, 46, 245, 0.3);
}

.stat-card i {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.25rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Creations Grid */
.creations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.creation {
    background: var(--card-background);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.creation:hover {
    transform: translateY(-5px);
}

.creation img, .creation video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.creation-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.creation h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.125rem * 1.2 * 2);
}

/* Creation Stats */
.creation-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 1rem;
}

.creation-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    min-width: 40px;
}

.creation-stat i {
    color: var(--primary-color);
    font-size: 1rem;
}

.creation-stat span {
    font-size: 0.75rem;
}

/* Tags */
.tag {
    background: var(--card-background);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tag i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.tag .ranking {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.tag .frequency {
    color: var(--text-primary);
    font-size: 0.625rem;
    margin-left: 0.25rem;
}
.tag-tracked.tag {
    border-width: thin;
    border-color: #ffffff4a;
    border-style: solid;
}

.tag-tracked.tag.low-ranking {
    background-color:  #ff000030;
}

/* Estilos específicos para tracked tags */
.tag.tracked-tag {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.tag.tracked-tag i {
    color: var(--primary-color);
}

.tag.tracked-tag .remove-tag {
    margin-left: 0.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.tag.tracked-tag .remove-tag:hover {
    opacity: 1;
}

/* Estilos específicos para creation tags */
.tag.tag-creation {
    color: var(--text-primary);
}

.tag.tag-creation i {
    color: var(--primary-color);
}

.tag.tracked-tag.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tag.tracked-tag.loading .ranking {
    opacity: 1;
    background: transparent;
    padding: 0;
}

.tag.tracked-tag.loading .ranking .fa-spinner {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* Profile Actions */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.btn-stats {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.btn-stats:hover {
    background: var(--secondary-color);
}

/* Creation Description */
.creation-description-section {
    margin: 1rem 0;
    padding: 0 1rem;
}

.creation-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.creation-description.collapsed {
    max-height: 4.5em; /* 3 lines */
    overflow: hidden;
}

.creation-description.expanded {
    max-height: none;
}

.description-toggle {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description-toggle:hover {
    color: #2563eb;
}

/* Additional Tag Styles */
.tag {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tag:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* Aseguramos que los creation tags mantengan su color al hacer hover */
.tag.tag-creation:hover {
    color: var(--primary-color);
}

.tag.temp-tag {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.tag.temp-tag i {
    color: var(--primary-color);
}

.tag .remove-tag {
    margin-left: 0.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

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

.tag.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tag.loading .ranking {
    opacity: 0;
}

/* Modal Tags */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    min-height: 3rem;
    transition: opacity 0.3s ease;
}

.modal-tags.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Specific styles for each type of tag container if needed */
.model-tags, .competition-tags, .tracked-tags {
    /* Common styles for all tag containers */
    min-height: 3rem;
}

.ai-tags {
    min-height: 0;
    padding: 0.5rem;
}

.ai-tags:not(:empty) {
    min-height: 3rem;
    padding: 1rem;
}

.tags-container {
    min-height: 3rem;
    transition: opacity 0.3s ease;
}

.tags-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Spinner pequeño */
.loading-spinner i {
    font-size: 12px;
    color: gray;
}

/* Label azul con padding y bordes redondeados */
.ranking-label {
    font-size: 12px;
    font-weight: bold;
    background-color: #007bff; /* Azul */
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 5px;
}

/* Label azul con padding y bordes redondeados */
.total-label {
    font-size: 12px;
    font-weight: bold;
    background-color: green; /* Azul */
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 5px;
}

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

.sort-select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(130, 46, 245, 0.3);
    background-color: var(--card-background);
    color: var(--text-primary);
    font-family: 'Barlow', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.sort-select:hover {
    border-color: var(--primary-color);
}

.sort-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 46, 245, 0.2);
}

/* Estilo para las opciones del select */
.sort-select option {
    background-color: var(--card-background);
    color: var(--text-primary);
}

/* Estilo para el título de creaciones */
h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tooltip styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.stat-card {
    position: relative;
}

.stat-card .tooltip-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    margin-left: 0;
    font-size: 0.85em;
    z-index: 10;
}

.modal-stat {
    position: relative;
}

.modal-stat .tooltip-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    margin-left: 0;
    font-size: 0.85em;
    z-index: 10;
}

.tooltip-icon {
    margin-left: 5px;
    color: var(--text-muted);
    cursor: help;
    font-size: 0.85em;
    transition: color 0.2s ease;
}

.tooltip-icon:hover {
    color: var(--primary-color);
}

.tooltip {
    visibility: hidden;
    position: absolute;
    background-color: var(--card-background);
    color: var(--text-color);
    text-align: center;
    padding: 10px 15px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
    border: 1px solid rgba(130, 46, 245, 0.2);
    text-wrap: auto;
}

.stat-card .tooltip {
    top: -5px;
    right: 25px;
    transform: translateY(-100%);
}

.modal-stat .tooltip {
    top: -5px;
    right: 25px;
    transform: translateY(-100%);
}

/*.tooltip::after {*/
/*    content: "";*/
/*    position: absolute;*/
/*    border-width: 8px;*/
/*    border-style: solid;*/
/*}*/

.stat-card .tooltip::after, .modal-stat .tooltip::after {
    top: auto;
    bottom: -16px;
    right: 10px;
    border-color: var(--card-background) transparent transparent transparent;
}

.tooltip-icon:hover + .tooltip, .tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* For mobile devices */
@media (max-width: 768px) {
    .tooltip {
        width: 200px;
        font-size: 0.8rem;
    }
}

/* Data Notice Warning */
.data-notice {
    background-color: #ebd48e4d;
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-notice i {
    color: #bfbfbf;
    font-size: 1rem;
}

.title-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy-tags {
    background: transparent;
    border: none;
    color: var(--text-primary);
    opacity: 0.5;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.btn-copy-tags:hover {
    opacity: 1;
}

.btn-copy-tags i {
    font-size: 0.875rem;
}

/* View Creation Button */
.view-creation-btn {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    width: 130px;
}

.view-creation-btn:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
    color: white;
}

.view-creation-btn i {
    font-size: 0.9rem;
}

/* Title container with button */
.title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-container.column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.title-container .title-text {
    flex: 1;
    font-weight: inherit;
    font-size: inherit;
    margin: 0;
}

.view-creation-btn.small {
    margin: 0;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.view-creation-btn.small.below-title {
    margin: 0;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.view-creation-btn.small:hover {
    background-color: var(--secondary-color);
    color: white;
}

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

.video-tutorial-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.video-tutorial-link:hover {
    background-color: rgba(130, 46, 245, 0.1);
    transform: translateY(-2px);
}

.video-tutorial-link i {
    font-size: 1.1rem;
}
