/* static/css/my_results_tab.css - Redesigned for Dark Mode and Modern UI */

/* --- Main Wrapper --- */
.my-results-redesign-wrapper {
    background-color: var(--dark-bg);
    padding: 2.5rem 1.5rem;
    min-height: calc(100vh - 120px);
}

/* --- Gallery Grid --- */
.results-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 0;
    direction: rtl;
}

/* --- Result Card Styling (Light Theme) --- */
.tryon-result-card {
    background-color: var(--card-bg, white);
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tryon-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* START OF MODIFIED CODE: Ensure vertical centering */
.tryon-result-card .result-image-wrapper {
    flex-grow: 1; /* Make this wrapper take up all available vertical space */
    display: flex;
    align-items: center; /* Vertically center the image inside */
    justify-content: center; /* Horizontally center the image inside */
    margin-bottom: 1rem;
    min-height: 220px;
}
/* END OF MODIFIED CODE */

.tryon-result-card img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    background-color: #f3f4f6;
    border-radius: 8px;
    cursor: zoom-in;
}

.tryon-result-card .result-info {
    font-size: 0.9em;
    color: #4b5563;
    margin-bottom: 1rem;
}
.tryon-result-card .result-info p { margin: 0 0 6px 0; }
.tryon-result-card .result-info strong {
    font-weight: 600;
    color: #111827;
}

/* Actions container - centers the buttons as a group */
.tryon-result-card .tryon-result-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    justify-content: center;
}

/*
 * --- START OF FINAL FIX ---
 * This unified rule is now highly specific to override the general 'button' style
 * that was causing the color conflict. It targets ALL buttons within the card actions container.
 */
.tryon-result-card .tryon-result-card-actions button {
    flex: 0 1 120px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;

    /* The winning style we want. 'background' is used to override 'background-color' and gradients. */
    background: #111827;
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hover Effect for standard buttons */
.tryon-result-card .tryon-result-card-actions button:not(.delete-result-button):hover {
    background: #374151; /* Lighter black/dark gray on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Hover Effect for the delete button */
.tryon-result-card .delete-result-button:hover {
    background: #ef4444;      /* Fill with red for danger */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
/* --- END OF FINAL FIX --- */


#my-results-status-message { max-width: 600px; margin: 10px auto; }
#my-results-loading, #my-results-empty {
    text-align: center;
    color: var(--medium-text);
    margin-top: 40px;
    padding: 3rem;
    background-color: var(--dark-bg-secondary);
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    grid-column: 1 / -1;
    font-size: 1.1rem;
    line-height: 1.7;
}

@media (max-width: 767px) {
    .my-results-redesign-wrapper { padding: 1.5rem 1rem; }
    .results-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
    .tryon-result-card { padding: 0.75rem; }
}

@media (max-width: 480px) {
    .results-gallery-grid { grid-template-columns: 1fr 1fr; }

    .tryon-result-card .tryon-result-card-actions {
        flex-direction: column;
        align-items: center;
    }

    .tryon-result-card .tryon-result-card-actions button {
        flex-basis: auto;
        width: 90%;
    }
}