/**
 * Frontend styles for Theater Sales Progress Monitor
 */

/* Container */
.tsp-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Access Denied */
.tsp-access-denied {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
}

/* No Events */
.tsp-no-events {
    padding: 20px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    text-align: center;
}

/* Table View */
.tsp-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    border-radius: 4px;
}

.tsp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tsp-table thead {
    background: #2c3e50;
    color: #fff;
}

.tsp-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tsp-table th.tsp-center {
    text-align: center;
}

.tsp-table th.tsp-right {
    text-align: right;
}

.tsp-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.tsp-table tbody tr {
    transition: background-color 0.2s ease;
}

.tsp-table tbody tr:hover {
    background-color: #f8f9fa;
}

.tsp-table tbody tr:last-child td {
    border-bottom: none;
}

.tsp-table .tsp-center {
    text-align: center;
}

.tsp-table .tsp-right {
    text-align: right;
}

.tsp-event-name {
    font-size: 16px;
    min-width: 200px;
}

.tsp-location {
    color: #6c757d;
    font-size: 13px;
}

.tsp-event-date {
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
}

/* Progress Bar */
.tsp-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.tsp-progress-bar {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.tsp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.tsp-percentage {
    font-weight: 600;
    font-size: 14px;
    min-width: 45px;
    text-align: right;
}

/* Status Colors */
.tsp-status-low .tsp-progress-fill {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.tsp-status-medium .tsp-progress-fill {
    background: linear-gradient(90deg, #ffc107 0%, #ffdb4d 100%);
}

.tsp-status-high .tsp-progress-fill {
    background: linear-gradient(90deg, #fd7e14 0%, #ff922b 100%);
}

.tsp-status-critical .tsp-progress-fill {
    background: linear-gradient(90deg, #dc3545 0%, #e35d6a 100%);
}

.tsp-revenue-potential {
    color: #6c757d;
    font-size: 12px;
}

/* Cards View */
.tsp-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tsp-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 4px solid #2c3e50;
}

.tsp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tsp-card.tsp-status-low {
    border-top-color: #28a745;
}

.tsp-card.tsp-status-medium {
    border-top-color: #ffc107;
}

.tsp-card.tsp-status-high {
    border-top-color: #fd7e14;
}

.tsp-card.tsp-status-critical {
    border-top-color: #dc3545;
}

.tsp-card-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tsp-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.tsp-card-date {
    font-size: 14px;
    color: #495057;
    margin-bottom: 4px;
}

.tsp-card-location {
    font-size: 13px;
    color: #6c757d;
}

.tsp-card-body {
    padding: 20px;
}

.tsp-card-progress {
    margin-bottom: 20px;
}

.tsp-card-progress .tsp-progress-bar {
    height: 30px;
    margin-bottom: 12px;
}

.tsp-percentage-large {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.tsp-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.tsp-stat {
    text-align: center;
}

.tsp-stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tsp-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
}

.tsp-card-revenue {
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tsp-revenue-earned {
    font-size: 16px;
}

.tsp-revenue-earned strong {
    color: #28a745;
    font-size: 18px;
}

.tsp-revenue-potential {
    font-size: 14px;
    color: #6c757d;
}

.tsp-revenue-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 5px;
}

/* Refresh Indicator */
.tsp-refresh-indicator {
    text-align: center;
    padding: 10px;
    color: #6c757d;
    font-style: italic;
    animation: tsp-pulse 2s infinite;
}

@keyframes tsp-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .tsp-table-wrapper {
        font-size: 14px;
    }

    .tsp-table th,
    .tsp-table td {
        padding: 10px 8px;
    }

    .tsp-event-name {
        font-size: 14px;
        min-width: 150px;
    }

    .tsp-progress-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .tsp-progress-bar {
        width: 100%;
    }

    .tsp-percentage {
        text-align: left;
    }

    .tsp-cards-wrapper {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 640px) {
    /* Stack table on mobile */
    .tsp-table thead {
        display: none;
    }

    .tsp-table,
    .tsp-table tbody,
    .tsp-table tr,
    .tsp-table td {
        display: block;
        width: 100%;
    }

    .tsp-table tr {
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
        border-radius: 4px;
        padding: 15px;
        background: #fff;
    }

    .tsp-table td {
        padding: 8px 0;
        border: none;
        text-align: left !important;
        position: relative;
        padding-left: 50%;
    }

    .tsp-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        color: #2c3e50;
    }

    .tsp-progress-wrapper {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .tsp-card {
        break-inside: avoid;
    }

    .tsp-table {
        page-break-inside: auto;
    }

    .tsp-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .tsp-refresh-indicator {
        display: none;
    }
}
