/* Portal Login Component - Complete styling */

/* Animated coin sprite - portal login specific */
@keyframes portalCoinSpin {
    0% { background-position: 0px 0px; }
    16.66% { background-position: -18px 0px; }
    33.32% { background-position: -36px 0px; }
    49.98% { background-position: -54px 0px; }
    66.64% { background-position: -72px 0px; }
    83.3% { background-position: -90px 0px; }
    100% { background-position: 0px 0px; }
}

.coin-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url('coin.png');
    background-size: 108px 18px; /* 6 frames * 18px */
    background-position: 0px 0px;
    image-rendering: pixelated;
    background-repeat: no-repeat;
    animation: portalCoinSpin 0.6s steps(1) infinite;
    vertical-align: middle;
    margin-left: 4px;
}

/* Login Button */
.portal-login-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    padding: 12px 24px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 50;
    border: none;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.portal-login-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* User Menu Dropdown */
.portal-user-menu {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 50;
    overflow: hidden;
    min-width: 200px;
    display: none;
}

.portal-user-menu button {
    width: 100%;
    padding: 16px 24px;
    text-align: left;
    border: none;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    transition: background 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.portal-user-menu button:hover {
    background: #f3f4f6;
}

.portal-user-menu button:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.portal-user-menu button.logout-btn {
    color: #dc2626;
}

.portal-user-menu button.logout-btn:hover {
    background: #fef2f2;
}

/* Modal Base */
.portal-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.portal-modal.active {
    display: flex;
}

/* Login Modal */
.portal-login-modal-content {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    padding: 32px;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.portal-modal-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s ease;
}

#portalLoginModal .portal-modal-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    color: white !important;
    font-size: 32px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    line-height: 1 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    text-align: right !important;
    z-index: 10 !important;
}

.portal-modal-close:hover {
    color: #e5e7eb;
}

.portal-modal h2 {
    color: white;
    margin: 0 0 24px 0;
    font-size: 28px;
    text-align: center;
    font-family: 'VT323', monospace, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.portal-modal p {
    color: white;
    margin-bottom: 16px;
    font-size: 15px;
}

.portal-modal input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.portal-modal input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.portal-modal button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.portal-modal-btn {
    background: white;
    color: #7c3aed;
    margin-bottom: 12px;
}

.portal-modal-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.portal-modal-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.portal-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.portal-modal-step {
    margin-top: 20px;
}

/* Tickets Modal */
.portal-tickets-modal-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 32px;
    border-radius: 24px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

#portalTicketsModal .portal-modal-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    color: white !important;
    font-size: 32px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    line-height: 1 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    text-align: right !important;
    z-index: 10 !important;
}

.portal-tickets-modal-content h2 {
    color: white;
    margin: 0 0 24px 0;
    padding-right: 60px; /* Make room for close button */
    text-align: left; /* Override center alignment */
    font-size: 28px;
}

.portal-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portal-ticket-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.portal-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-ticket-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 8px 0;
}

.portal-ticket-info {
    color: #d1d5db;
    margin: 4px 0;
    font-size: 15px;
}

.portal-ticket-badge {
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.portal-ticket-badge.valid {
    background: #3b82f6;
    color: white;
}

.portal-ticket-badge.checked-in {
    background: #10b981;
    color: white;
}

.portal-ticket-badge.event-over {
    background: #6b7280;
    color: white;
}

.portal-ticket-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.portal-ticket-detail-label {
    color: #9ca3af;
    font-size: 12px;
    margin: 0 0 4px 0;
}

.portal-ticket-detail-value {
    color: white;
    font-weight: bold;
    margin: 0;
    font-size: 15px;
}

.portal-ticket-detail-value.price {
    color: #10b981;
}

.portal-ticket-detail-value.id {
    font-family: monospace;
    font-size: 13px;
}

.portal-resend-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: white;
    font-weight: bold;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    width: 100%;
}

.portal-resend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.portal-resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading/Error/Empty States */
.portal-state-message {
    text-align: center;
    padding: 40px 20px;
}

.portal-state-message p {
    font-size: 18px;
    margin: 8px 0;
}

.portal-state-message p:first-child {
    font-size: 20px;
    font-weight: bold;
}
