/* Alumni Digital Membership Card Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 0;
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.header-section {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    color: white;
}

.header-image {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    object-position: center;
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.3s ease;
    display: block;
    border-radius: 20px 20px 0 0;
}

.header-image.contain-mode {
    object-fit: contain;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.header-text-fallback {
    text-align: center;
    display: none;
}

.header-text-fallback.show {
    display: block;
}

.header-text-fallback h1 {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-text-fallback p {
    font-size: 1.1em;
    opacity: 0.9;
}

.content-section {
    padding: 40px;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color, #667eea);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.loading-subtext {
    color: #999;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.error-details {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: left;
}

.error-details strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.error-details code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.retry-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.retry-button:hover {
    background: #5a6fd8;
}

.image-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 0 -10px;
}

.image-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.api-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
}

.api-status.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.api-status.fallback {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.api-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.green { background: #28a745; }
.status-indicator.yellow { background: #ffc107; }
.status-indicator.red { background: #dc3545; }

.tenant-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    border-left: 4px solid var(--primary-color, #667eea);
}

.tenant-info h3 {
    color: var(--primary-color, #667eea);
    margin-bottom: 10px;
    font-size: 1.3em;
}

.tenant-info p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: slideIn 0.4s ease;
}

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

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
}

.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
    position: relative;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--primary-color, #667eea);
    color: white;
}

.step-dot.completed {
    background: #4caf50;
    color: white;
}

.step-dot:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #e0e0e0;
    transform: translateY(-50%);
}

/* Hide the line after step 3 by default */
#dot3::after {
    display: none;
}

/* Show the line after step 3 only when it has a next step */
#dot3.has-next-step::after {
    display: block;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.otp-input {
    width: 50px !important;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    padding: 0px !important;
}

.otp-input:focus {
    border-color: var(--primary-color, #667eea);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%) !important;
    background-image: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6c757d !important;
    background-image: none !important;
    margin-top: 15px;
}

.success-message {
    background: #efe;
    color: #080;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

.congratulations {
    text-align: center;
}

.congratulations h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.congratulations p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.record-selection {
    text-align: center;
}

.record-selection h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.record-selection p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.5;
}

.selection-icon {
    font-size: 60px;
    color: var(--primary-color, #667eea);
    margin-bottom: 20px;
}

.record-list {
    margin-bottom: 25px;
    text-align: left;
}

.record-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.record-item:hover {
    border-color: var(--primary-color, #667eea);
    background: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.record-item.selected {
    border-color: var(--primary-color, #667eea);
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 0 0 1px var(--primary-color, #667eea);
}

.record-item.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 16px;
    color: var(--primary-color, #667eea);
    font-weight: bold;
    font-size: 18px;
}

.record-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.record-details {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.record-meta {
    font-size: 0.8em;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.wallet-icon {
    font-size: 80px;
    color: rgb(34 197 94); 
    width: 64px; 
    height: 64px; 
    margin-bottom: 20px;
}

/* Official Wallet Button Styles */
.wallet-button-container {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.official-wallet-button {
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    border: none;
    background: transparent;
    padding: 0;
}

.official-wallet-button:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

.official-wallet-button:active {
    transform: translateY(0) scale(0.98);
}

.official-wallet-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.wallet-button-svg {
    width: 200px;
    height: auto;
    display: block;
}

.platform-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 10px;
    text-align: center;
    max-width: 300px;
    display: none;
}

/* Loading state for wallet button */
.wallet-button-loading {
    position: relative;
}

.wallet-button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

.wallet-button-loading .wallet-button-svg {
    opacity: 0.5;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        width: 100%;
        max-width: calc(100% - 0px);
    }

    .content-section {
        padding: 20px;
    }

    .header-section {
        padding: 20px;
        min-height: 100px;
    }

    .header-image {
        max-height: 60px;
    }

    .header-text-fallback h1 {
        font-size: 1.8em;
    }

    .otp-input {
        width: 40px !important;
        height: 50px;
        font-size: 18px;
        padding: 0px !important;
    }
    
    .otp-container {
        gap: 8px;
    }

    .step-indicator {
        gap: 15px;
    }

    .step-dot {
        width: 35px;
        height: 35px;
    }

    .step-dot:not(:last-child)::after {
        width: 15px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .wallet-button-svg {
        width: 180px;
    }

    .platform-description {
        font-size: 0.85em;
        display: none;
    }
}

/* Extra small devices (340px and down) */
@media (max-width: 340px) {
    body {
        padding: 5px;
    }
    
    .content-section {
        padding: 15px;
    }
    
    .otp-input {
        width: 35px !important;
        height: 45px;
        font-size: 16px;
        padding: 0px !important;
        border-width: 1px;
    }
    
    .otp-container {
        gap: 6px;
        justify-content: center;
    }
    
    .form-group label {
        font-size: 14px;
        text-align: center;
    }
    
    .btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Ultra small devices - iPhone 4 and similar (320px and down) */
@media (max-width: 320px) {
    body {
        padding: 3px;
    }
    
    .content-section {
        padding: 12px;
    }
    
    .otp-input {
        width: 30px !important;
        height: 40px;
        font-size: 14px;
        padding: 0px !important;
        border-width: 1px;
    }
    
    .otp-container {
        gap: 4px;
        justify-content: center;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 13px;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .btn {
        padding: 10px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .header-text-fallback h1 {
        font-size: 1.5em;
    }
    
    .tenant-info {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .tenant-info h3 {
        font-size: 1.1em;
    }
}

/* Dark theme support for header images */
@media (prefers-color-scheme: dark) {
    .header-image.auto-invert {
        filter: brightness(1.1) contrast(1.1) invert(1);
    }
}

/* User Agent Footer */
.user-agent-footer {
    margin-top: 30px;
    padding: 15px;
    text-align: center;
    opacity: 0.5;
    font-size: 10px;
    color: #666;
    word-break: break-all;
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-agent-footer:hover {
    opacity: 0.8;
}

.user-agent-footer small {
    display: block;
    line-height: 1.4;
}