@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;600&display=swap');

:root {
    --primary: #800000; /* Maroon */
    --primary-glow: rgba(128, 0, 0, 0.4);
    --secondary: #f59e0b; /* Gold */
    --accent: #4c0519; /* Deep Maroon */
    --bg-dark: #0a0505;
    --card-bg: rgba(20, 5, 5, 0.85);
    --text-main: #ffffff;
    --text-dim: #d1d5db;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Liquid / Water-like Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0505;
    z-index: -2;
}

.water-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(40px); /* Reduced blur for clearer movement */
    opacity: 0.7;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    opacity: 0.6;
    animation: move 15s infinite ease-in-out alternate;
}

.blob:nth-child(2) {
    background: linear-gradient(135deg, #4b0b0b, #800000);
    width: 800px;
    height: 800px;
    right: -200px;
    top: -200px;
    animation-duration: 20s;
    animation-delay: -2s;
}

.blob:nth-child(3) {
    background: linear-gradient(135deg, #2a0505, #4c0519);
    width: 700px;
    height: 700px;
    left: -150px;
    bottom: -150px;
    animation-duration: 18s;
    animation-delay: -5s;
}

.blob:nth-child(4) {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    width: 500px;
    height: 500px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 12s infinite ease-in-out alternate;
}

@keyframes move {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { transform: translate(15%, 10%) rotate(90deg) scale(1.2); border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { transform: translate(-10%, 20%) rotate(180deg) scale(1); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    100% { transform: translate(-40%, -60%) scale(1.5); opacity: 0.5; }
}

.container {
    width: 100%;
    max-width: 550px;
    z-index: 10;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1);
}

header .logo-wrapper {
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

header p {
    color: var(--text-dim);
    font-size: 1rem;
    opacity: 0.8;
}

/* Search Area */
.search-container {
    position: relative;
    z-index: 100; /* Ensure search is always on top */
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.4rem 1.5rem;
    padding-left: 3.8rem;
    padding-right: 4rem;
    color: white;
    font-size: 1.2rem;
    outline: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.search-box:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 30px var(--primary-glow), 0 20px 50px -10px rgba(0, 0, 0, 0.6);
    background: rgba(30, 10, 10, 0.9);
}

.search-box::placeholder {
    color: transparent;
}

/* Marquee Placeholder */
.marquee-placeholder {
    position: absolute;
    left: 3.8rem;
    right: 4rem;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 15s linear infinite;
}

.marquee-content span {
    font-size: 1.1rem;
    color: var(--text-dim);
    padding-right: 2rem;
}

.search-box:focus + .marquee-placeholder,
.search-box:not(:placeholder-shown) + .marquee-placeholder {
    display: none;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.search-icon {
    position: absolute;
    left: 1.4rem;
    color: var(--secondary);
    font-size: 1.3rem;
    pointer-events: none;
}

.clear-btn {
    position: absolute;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.clear-btn.active {
    opacity: 1;
    pointer-events: auto;
}

.clear-btn:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

/* Suggestions - Fixed Z-Index and Overlap */
.suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(40, 10, 10, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 18px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000; /* Extremely high to be above result card */
    display: none;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.suggestion-item {
    padding: 1.2rem 1.8rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.suggestion-item:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2), transparent);
    padding-left: 2.2rem;
}

.suggestion-item .name {
    display: block;
    font-weight: 600;
    color: var(--secondary);
    font-size: 1.1rem;
}

.suggestion-item .sub {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Result Card - Enhanced Professional Look */
.result-container {
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.result-card {
    background: linear-gradient(145deg, rgba(40, 10, 10, 0.6) 0%, rgba(10, 5, 5, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    display: none;
    animation: resultEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8);
    position: relative;
}

.result-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, var(--secondary), transparent, var(--primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2rem;
}

.result-badge-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.id-section {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: default;
}

.id-section:hover {
    border-color: rgba(245, 158, 11, 0.6);
    background: rgba(20, 5, 5, 0.6);
}

.id-row {
    display: flex;
    align-items: stretch; /* Stretch children to full height */
    justify-content: space-between;
    width: 100%;
}

.id-content-wrapper {
    padding: 1.2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.id-label-main {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.6rem;
    font-weight: 600;
    opacity: 0.7;
}

.id-badge, .email-badge {
    font-size: clamp(1rem, 4.5vw, 1.8rem); /* Slightly smaller base for ID */
    font-weight: 700;
    color: white;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    letter-spacing: 1px;
    font-family: 'Monaco', 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-badge {
    font-size: clamp(0.85rem, 3.5vw, 1.2rem); /* Significantly smaller for email to fit */
    opacity: 0.9;
}

.copy-btn {
    background: rgba(245, 158, 11, 0.15); /* Slightly more visible background */
    border: none;
    border-left: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--secondary);
    width: 65px;
    min-width: 65px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.3rem;
}

.copy-btn:hover {
    background: var(--secondary);
    color: #000;
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: #10b981;
    color: white;
}

.info-grid {
    display: grid;
    gap: 2rem;
}

.info-group .label {
    display: block;
    font-size: 0.85rem;
    color: #ffffff; /* White label */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.info-group .value {
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.major-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 0.5rem 1.2rem;
    border-radius: 12px;
    color: var(--secondary); /* Gold color */
    font-weight: 600;
    margin-top: 0.5rem;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
}

.btn-new {
    flex: 1;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border: none;
    padding: 1rem;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px var(--primary-glow);
    filter: brightness(1.1);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes resultEntrance {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    header h1 { font-size: 1.8rem; }
    .search-box { padding: 1.2rem; padding-left: 3.5rem; font-size: 1.1rem; }
    .result-card { padding: 1.5rem; }
    .id-section { padding: 0; } /* Ensure no padding so button touches edge */
    .id-badge { letter-spacing: 1px; }
    .info-group .value { font-size: 1.2rem; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.4); }

/* QR Toggle Button */
.qr-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(245, 158, 11, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    color: var(--secondary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.qr-toggle-btn:hover {
    transform: scale(1.15) rotate(15deg);
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

/* QR Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: linear-gradient(145deg, rgba(40, 10, 10, 0.95) 0%, rgba(10, 5, 5, 1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 32px;
    padding: 3rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(220, 38, 38, 0.5);
    transform: rotate(90deg);
}

.qr-code-container {
    background: white;
    padding: 1.2rem;
    border-radius: 20px;
    margin: 0 auto 2rem;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}

.qr-code-container img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.qr-placeholder {
    color: #4b0b0b;
    font-size: 2rem;
}

.url-display {
    font-size: 0.75rem;
    color: var(--secondary);
    font-family: monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 12px;
    word-break: break-all;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Mobile Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
        margin-top: 2rem;
    }

    h1 { font-size: 1.8rem; }
    .subtitle { font-size: 0.85rem; }

    .result-card {
        padding: 1.2rem;
    }

    .id-content-wrapper {
        padding: 0.8rem 1rem;
        min-width: 0;
        flex: 1;
    }

    .id-badge {
        font-size: clamp(1.1rem, 4.5vw, 1.4rem);
        line-height: 1.1;
    }

    .email-badge {
        font-size: clamp(0.75rem, 3.2vw, 0.9rem);
        line-height: 1.1;
    }

    .copy-btn {
        width: 48px;
        min-width: 48px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-card {
        width: 95%;
        padding: 1.5rem;
        border-radius: 24px;
    }

    .qr-toggle-btn { 
        bottom: 1.5rem; 
        right: 1.5rem; 
        width: 50px; 
        height: 50px; 
        font-size: 1.2rem; 
    }

    .guide-modal {
        max-height: 85vh;
    }

    .guide-header {
        padding: 1.8rem 1.2rem 1rem;
    }

    .guide-content {
        padding: 1rem 1.2rem;
    }

    .step-item {
        gap: 1rem;
        padding: 1rem;
    }

    .step-num {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.9rem;
    }

    .step-info h4 {
        font-size: 0.95rem;
    }

    .step-info p {
        font-size: 0.8rem;
    }

    .tab-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* Guide Styles */
.guide-trigger-wrapper {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    animation: fadeIn 1s ease 0.5s both;
}

.btn-guide {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 320px;
    justify-content: center;
    text-decoration: none; /* Remove underline */
}

.btn-guide:hover {
    background: rgba(245, 158, 11, 0.15);
    color: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.2);
}

@media (max-width: 600px) {
    .btn-guide { width: 90%; font-size: 0.9rem; }
}
