/* ===== SECRETOS PAGE STYLES ===== */

/* Main Layout */
.secretos-main {
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    padding: 3rem 0;
    min-height: 100vh;
}

/* Page Heading */
.page-heading {
    text-align: center;
    margin-bottom: 2rem;
}

.page-heading h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
}

/* Sorting Controls */
.sorting-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sorting-controls label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

/* Sort Filter Dropdown - Custom styling matching header dropdown */
.sort-filter-dropdown {
    position: relative;
    width: 250px;
    height: 44px;
}

.sort-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background: var(--gray-10);
    border-radius: 20px;
    color: var(--primary-color-lighter);
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.sort-filter-trigger::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url('/static/img/chevron-down.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    right: 0.7rem;
}

.sort-filter-trigger:hover {
    border-color: var(--accent-color-50);
    box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.15);
    background: var(--gray-10);
}

.sort-filter-dropdown:focus-within .sort-filter-trigger,
.sort-filter-dropdown.active .sort-filter-trigger {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-50), 0.3), 0 4px 12px rgba(var(--primary-color-rgb), 0.1);
    background: var(--gray-10);
}

.sort-filter-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--gray-10);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    display: none;
    min-width: 240px;
    z-index: 999;
    width: 100%;
    box-sizing: border-box;
}

.sort-filter-options::before {
    content: '';
    position: absolute;
    height: 12px;
    width: 100%;
    top: -12px;
    left: 0;
}

.sort-option {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    transition: background-color 0.25s ease;
    padding: 0.75rem 1.25rem;
    margin: 0.3rem 0.75rem;
    border-radius: 6px;
    width: calc(100% - 1.5rem);
    box-sizing: border-box;
    font-weight: 500;
}

.sort-option:hover {
    background-color: rgba(255, 182, 255, 0.3);
}

.sort-option.active {
    background-color: var(--accent-color-10);
    color: var(--primary-color);
}

/* Show dropdown content on hover and when active */
.sort-filter-dropdown:hover .sort-filter-options,
.sort-filter-dropdown.active .sort-filter-options {
    display: block;
}

/* Grid Layout */
.secretos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card Animation Styles */
.secreto-card.sorting {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.secreto-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.secreto-card.fade-in {
    opacity: 1;
    transform: scale(1);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.secreto-card.slide-in {
    animation: cardSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== SECRETO CARDS ===== */

/* Card Base */
.secreto-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 182, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.secreto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 182, 255, 0.3);
    z-index: 2;
}

.secreto-card.expanded {
    transform: none;
}

/* Card Content */
.secreto-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.secreto-description {
    margin-bottom: 1.5rem;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Card Controls */
.card-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

/* Ensure status icon has proper spacing when it's the only control */
.card-controls .status-icon:only-child {
    margin-right: 0.25rem;
}

/* Status Icon */
.status-icon {
    width: 32px;
    height: 32px;
    cursor: help;
    transition: all 0.3s ease;
}

.status-icon svg {
    width: 100%;
    height: 100%;
}

.status-icon[data-status="active"] {
    color: #28a745;
}

.status-icon[data-status="funded"] {
    color: #ffc107;
}

.status-icon[data-status="completed"] {
    color: #17a2b8;
}

.status-icon:not([data-status="active"]):not([data-status="funded"]):not([data-status="completed"]) {
    color: #6c757d;
}

.status-icon:hover {
    transform: scale(1.1);
}

/* Disable default tooltip */
.status-icon[data-tooltip]:hover::after,
.status-icon[data-tooltip]:hover::before {
    display: none;
}

/* Visibility Toggle */
.visibility-toggle {
    cursor: pointer;
}

.toggle-switch {
    width: 32px;
    height: 18px;
    background-color: #e5e7eb;
    border-radius: 9px;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background-color: var(--primary-color);
}

.toggle-circle {
    width: 14px;
    height: 14px;
    background-color: var(--gray-1);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-circle {
    transform: translateX(14px);
}

/* Delete Icon */
.delete-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-icon svg {
    width: 100%;
    height: 100%;
}

.delete-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #dc2626;
}

/* ===== PROGRESS SECTION ===== */

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--anchor-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.funded {
    color: var(--success-green);
    font-weight: 600;
}

/* ===== MODEL BADGES ===== */

/* Model Selection Container */
.secreto-card .models-selection,
.models-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 15px 0;
}

.models-selection {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    position: relative;
}

/* Model Badge Base */
.model-badge {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
    background-color: var(--gray-1);
}

/* Model Badge in Cards */
.secreto-card .model-badge {
    border-color: var(--accent-color);
    background-color: var(--accent-color-10);
    color: var(--primary-color);
    font-weight: 600;
    transform: translateY(-2px);
}

/* Model Badge Hover States */
.model-badge:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-color-10);
    transform: translateY(-2px);
}

.secreto-card .model-badge:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-color-10);
    transform: translateY(-2px);
}

/* Model Badge Selected State */
.model-badge.selected {
    border-color: var(--accent-color);
    background-color: var(--accent-color-10);
    transform: translateY(-2px);
}

.secreto-card .model-name {
    color: inherit;
}

/* Model Hover Images */
.model-hover-image {
    position: fixed;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10001;
    pointer-events: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.model-hover-image img {
    width: 240px;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--gray-1);
    display: block;
}

/* ===== EXPANDABLE DETAILS ===== */

.secreto-details {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 182, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.secreto-details .details-content .full-description {
    margin: 0 0 1rem 0;
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 0.95rem;
}

.secreto-details .details-content .model-links {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.secreto-details .details-content .model-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.secreto-details .details-content .model-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.secreto-details .details-content .bullet {
    color: var(--gray-400);
    margin: 0 0.25rem;
}

.secreto-details .details-content .created-date {
    margin: 1rem 0 0 0;
    color: var(--gray-600);
    font-size: 0.85rem;
    font-style: italic;
}

/* ===== ACTIONS ===== */

.secreto-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.secreto-actions .btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

/* Like Button */
.like-btn {
    background: none;
    border: none;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.like-btn:hover {
    color: var(--accent-color);
}

.like-btn.liked {
    color: var(--accent-color);
}

.like-btn svg,
.like-btn img {
    width: 20px;
    height: 20px;
}

.like-btn svg {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.like-btn img {
    transition: filter 0.3s ease;
}

.like-btn:hover svg {
    stroke: var(--accent-color);
}

.like-btn:hover img {
    filter: brightness(0) saturate(100%) invert(85%) sepia(100%) saturate(1000%) hue-rotate(270deg) brightness(110%) contrast(100%);
}

.like-btn.liked svg {
    fill: var(--accent-color);
    stroke: var(--accent-color);
}

.like-btn.liked img {
    filter: brightness(0) saturate(100%) invert(85%) sepia(100%) saturate(1000%) hue-rotate(270deg) brightness(110%) contrast(100%);
}

/* ===== TOOLTIPS ===== */

.custom-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--gray-800);
    color: var(--gray-1);
    padding: 12px 16px;
    border-radius: 8px;
    white-space: pre-line;
    z-index: 10000;
    min-width: 240px;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.custom-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.tooltip-line {
    font-size: 14px;
    font-weight: 500;
}

.tooltip-line.created {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}

.tooltip-line.reason {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
    font-style: italic;
}

.simple-tooltip {
    position: absolute;
    background-color: var(--gray-800);
    color: var(--gray-1);
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10000;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* ===== MODALS ===== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    overflow: hidden;
}

.modal-content {
    background-color: var(--gray-1);
    margin: 5% auto;
    padding: 1rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    background-color: var(--gray-1);
    border-radius: 12px 12px 0 0;
}

/* CAPTCHA positioning for Create Secreto modal */
.modal-content .captcha-container {
    justify-content: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-body {
    padding: 2rem;
    background-color: var(--gray-1);
    overflow: visible;
    position: relative;
}

.close {
    color: var(--gray-500);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ===== FORMS ===== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 182, 255, 0.2);
}

.help-text {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-top: 0.25rem;
}

.captcha-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

/* ===== UTILITY COMPONENTS ===== */

/* No Content */
.no-content {
    text-align: center;
    color: var(--gray-700);
    padding: 3rem;
    grid-column: 1 / -1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    background: var(--gray-1);
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--gray-300);
    transition: all 0.3s ease;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-color);
    color: var(--gray-1);
    border-color: var(--primary-color);
}

/* Submit Secreto Button */
.submit-secreto-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}

#submit-secreto-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--primary-color);
    border: none;
    color: var(--gray-1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(19, 33, 22, 0.3);
    transition: all 0.3s ease;
}

#submit-secreto-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(19, 33, 22, 0.4);
}

#submit-secreto-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--gray-1);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .page-heading h1 {
        font-size: 2rem;
    }

    .secretos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .secreto-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* ===== ADMIN MODAL STYLES ===== */

.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.admin-modal.show {
    display: block;
}

.admin-modal-content {
    background: var(--gray-10);
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.admin-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--gray-10);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.admin-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.admin-close-modal:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.admin-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 480px) {
    .page-heading {
        margin-bottom: 2rem;
    }

    .page-heading h1 {
        font-size: 1.8rem;
    }

    .secretos-main {
        padding: 1rem 0;
    }

    .secreto-card {
        padding: 1rem;
    }

    .status-icon {
        width: 20px;
        height: 20px;
    }

    #submit-secreto-btn {
        width: 50px;
        height: 50px;
    }

    #submit-secreto-btn svg {
        width: 20px;
        height: 20px;
    }

    .admin-modal {
        padding: 10px;
    }

    .admin-modal-content {
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }

    .admin-modal-header {
        padding: 15px;
    }

    .admin-modal-body {
        padding: 15px;
    }
}