/* History Page Specific Styles */

.history-container {
    max-width: 1000px;
    /* Wider for table/grid */
}

.history-controls {
    text-align: center;
}

.history-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}

/* History Selector Styles */
.history-controls {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 30px;
}

.history-controls .input-group {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.history-controls label {
    text-align: center;
    color: var(--gold-dark);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.history-controls select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 15px 40px 15px 20px;
    /* Right padding for arrow */
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: #ffd700;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(40, 40, 40, 0.9));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    /* Might not work on all browsers for select but worth a try */
    text-align-last: center;
    /* For Chrome */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 20px;
}

.history-controls select:hover,
.history-controls select:focus {
    border-color: var(--gold-light);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    outline: none;
}

.history-controls select option {
    background-color: #111;
    color: #fff;
    font-family: 'Noto Sans SC', sans-serif;
    padding: 12px;
}

/* History Summary Stats */
.history-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease-out;

    @media (min-width: 600px) {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.summary-card {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--gold-light), var(--gold-dark));
}

.summary-label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.summary-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--gold-light);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.summary-sub {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* History Card List (Mobile First / Responsive) */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}

.history-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.history-prize-type {
    font-family: 'Orbitron', sans-serif;
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1rem;
}

.history-ticket {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 1px;
}

.history-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9rem;
}

.history-item {
    display: flex;
    flex-direction: column;
}

.history-label {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.history-value {
    color: #ddd;
    font-family: 'Noto Sans SC', sans-serif;
}

.history-value.mono {
    font-family: 'Orbitron', monospace;
}

.history-value.hash {
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: #aaddff;
}

.history-card-footer {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

/* Prize Type Highlighting */
.prize-first {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.prize-second {
    color: #c0c0c0;
}

.prize-third {
    color: #cd7f32;
}

/* Desktop Grid View */
@media (min-width: 768px) {
    .history-card-body {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

/* Link Styles */
a.history-value.hash {
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

a.history-value.hash:hover {
    color: #ffd700;
    text-decoration: underline;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .history-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-prize-type {
        font-size: 1rem;
        line-height: 1.2;
        width: 100%;
        word-wrap: break-word;
    }

    .history-ticket {
        font-size: 1.3rem;
        align-self: flex-end;
        color: #fff;
    }

    .history-card-body {
        gap: 8px;
        font-size: 0.85rem;
    }

    .history-value {
        font-size: 0.95rem;
    }

    /* Ensure summary cards stack well or are smaller */
    .summary-card {
        padding: 10px;
    }

    .summary-value {
        font-size: 1.2rem;
    }
}

/* View All Button */
.history-btn-view-all {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-main));
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 167, 36, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* History Header Optimization */
.history-container .verify-header {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.history-container .logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    margin-bottom: 0;
    background: linear-gradient(to bottom, #fff, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    line-height: 1.2;
}

.history-container .verify-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin: 0;
    opacity: 0.8;
    line-height: 1.2;
}

.history-container .back-link {
    display: inline-block;
    margin-top: 5px;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.history-container .back-link:hover {
    border-color: var(--gold-light);
    color: var(--gold-light);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}