/* CSS Variables */
:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-color: #ffffff;
    --accent-color: #00d2ff;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Home Button */
.home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.home-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

@media (max-width: 600px) {
    .home-btn {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    /* Keep gradient fixed on scroll */
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Ambient Background blobs */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle, rgba(255, 0, 150, 0.05) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

h1 {
    font-weight: 600;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Controls Area */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 800px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.name-box {
    width: 100%;
    max-width: 500px;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.name-box label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin-left: 5px;
}

.name-box .input-wrapper {
    position: relative;
}

.control-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.name-box input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border-radius: 12px;
    /* Differentiated shape */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus,
.name-box input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    border-color: rgba(0, 210, 255, 0.5);
}

.search-box i,
.name-box .input-wrapper i {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.name-box .input-wrapper i {
    color: var(--accent-color);
    left: 20px;
    font-size: 1.1rem;
}

.btn-random {
    padding: 0 25px;
    height: 46px;
    /* Match input height roughly */
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-random:active {
    transform: translateY(0);
}

.btn-show-all {
    padding: 0 25px;
    height: 46px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-show-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.4);
}

.btn-show-all:active {
    transform: translateY(0);
}

.btn-copy-all {
    padding: 0 25px;
    height: 46px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-copy-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 239, 125, 0.4);
}

.btn-copy-all:active {
    transform: translateY(0);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1400px;
}

/* Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    background: rgba(255, 255, 255, 0.15);
}

/* Card Decoration */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.card-header h2 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 5px;
}

.card-header .country {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-header .party {
    font-size: 0.85rem;
    color: #00d2ff;
    margin-top: 5px;
    font-style: italic;
}

.card-body {
    margin-top: auto;
    /* Push footer down */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    gap: 10px;
    overflow: hidden;
}

.email-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
}

.email-link {
    display: flex;
    flex: 1;
    text-decoration: none;
    overflow: hidden;
}

.email-link:hover .email-text {
    color: var(--accent-color);
}

.btn-copy {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px;
}

.btn-copy:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}


.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

.social-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn-random {
        width: 100%;
        justify-content: center;
    }
}