/**
 * Fluent Forms User Submissions Styles
 * @package Fluent_Forms_User_Submissions
 */

/* Main wrapper */
.ffus-submissions-wrapper {
    margin: 0 0 2em;
}

.ffus-submissions-wrapper h2 {
    margin-bottom: 1.5em;
}

/* Stats section */
.ffus-submissions-stats {
    margin-bottom: 1.5em;
}

.ffus-submissions-stats p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
}

/* Grid layout */
.ffus-submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5em;
    margin-bottom: 2em;
}

/* Card layout */
.ffus-submission-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.ffus-submission-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image section */
.ffus-submission-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffus-submission-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ffus-submission-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    color: #999;
}

.ffus-submission-no-image svg {
    opacity: 0.5;
}

.ffus-submission-no-image span {
    font-size: 0.875em;
}

/* Content section */
.ffus-submission-content {
    flex: 1;
    padding: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.ffus-submission-header {
    display: flex;
    align-items: center;
}

.ffus-submission-event-badge {
    display: inline-block;
    padding: 0.35em 0.75em;
    font-size: 0.75em;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
    border-radius: 4px;
}

.ffus-submission-details {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.ffus-submission-car-name {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.ffus-submission-date {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 0;
    font-size: 0.875em;
    color: #666;
}

.ffus-submission-date svg {
    flex-shrink: 0;
}

/* Status section */
.ffus-submission-status {
    padding: 1em;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75em;
}

/* Badge styles */
.ffus-badge {
    display: inline-block;
    padding: 0.5em 1em;
    font-size: 0.875em;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
}

.ffus-badge-success {
    background-color: #28a745;
    color: #fff;
}

.ffus-badge-info {
    background-color: #17a2b8;
    color: #fff;
}

.ffus-badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.ffus-badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.ffus-badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

.ffus-badge-default {
    background-color: #e9ecef;
    color: #495057;
}

.ffus-badge-custom {
    color: #fff;
}

/* Submission actions (purchase buttons) */
/* Minimal styles - customize via Breakdance */
.ffus-submission-actions {
    /* No default styles - controlled by Breakdance */
}

/* When actions are inside status section, push badge to the right */
.ffus-submission-status .ffus-submission-actions {
    margin-right: auto;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .ffus-submissions-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }

    .ffus-submission-image {
        height: 180px;
    }

    /* Stack button and badge on smaller screens */
    .ffus-submission-status {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }

    .ffus-submission-status .ffus-submission-actions {
        margin-right: 0;
    }
}

@media screen and (max-width: 480px) {
    .ffus-submission-image {
        height: 150px;
    }

    .ffus-submission-content {
        padding: 0.875em;
    }

    .ffus-submission-car-name {
        font-size: 1em;
    }
}

/* Pagination compatibility */
.ffus-submissions-wrapper .woocommerce-pagination {
    margin-top: 2em;
}

/* WooCommerce info message */
.ffus-submissions-wrapper .woocommerce-info {
    margin: 1.5em 0;
}

/* Vehicle registered confirmation */
.ffus-submission-registered {
    padding: 1em;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    color: #22c55e;
    font-weight: 600;
    font-size: 0.95em;
}

/* My Tickets page optimizations */
.ffus-tickets-section {
    margin-bottom: 3em;
}

.ffus-tickets-section h2 {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5em;
    margin-bottom: 1.5em;
}

/* Tickets table optimizations */
.woocommerce-table--order-downloads {
    border-collapse: collapse;
    width: 100%;
}

.woocommerce-table--order-downloads thead {
    background: #f7f7f7;
}

.woocommerce-table--order-downloads th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.woocommerce-table--order-downloads td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.woocommerce-table--order-downloads tbody tr:hover {
    background: #fafafa;
}

/* Event date styling */
.woocommerce-table--order-downloads .download-file small {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .woocommerce-table--order-downloads {
        font-size: 0.9em;
    }

    .woocommerce-table--order-downloads th,
    .woocommerce-table--order-downloads td {
        padding: 8px;
    }
}

/* Section titles */
.ffus-tickets-section-title {
    margin-top: 3em;
    margin-bottom: 1.5em;
}

.ffus-tickets-section-title:first-of-type {
    margin-top: 1.5em;
}

/* Past tickets wrapper with gradient and show more */
.ffus-past-tickets-wrapper {
    position: relative;
    margin-bottom: 2em;
}

/* Fix table layout to prevent column shifting */
.ffus-past-tickets-wrapper table {
    table-layout: auto !important;
    width: 100%;
}

.ffus-past-tickets-wrapper .ffus-past-tickets-hidden td {
    vertical-align: middle;
}

/* Force hidden rows to use same display as visible rows */
.ffus-past-tickets-wrapper .ffus-past-tickets-hidden {
    display: none !important;
}

.ffus-past-tickets-wrapper .ffus-past-tickets-hidden td:before {
    content: none !important;
}

.ffus-past-tickets-wrapper.ffus-collapsed .ffus-gradient-overlay {
    display: block;
}

.ffus-past-tickets-wrapper.ffus-expanded .ffus-gradient-overlay {
    display: none;
}

.ffus-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    z-index: 1;
}

.ffus-show-more-wrapper {
    text-align: center;
    margin-top: 1.5em;
    position: relative;
    z-index: 2;
}

.ffus-show-more-btn {
    display: inline-block;
    text-decoration: none;
}

.ffus-past-tickets-hidden {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom icon for empty submissions message */
.ffus-no-submissions-message::before {
    content: '' !important;
    display: inline-block !important;
    width: 1.5em !important;
    height: 1.5em !important;
    margin-right: 0.5em !important;
    background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="%236c757d" d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm1 18h-2v-6h-2v-2h4v8zm-1-9.75c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25z"/%3E%3C/svg%3E') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    vertical-align: middle !important;
}
