:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-primary: #00f2ea;
    --accent-secondary: #3b82f6;
    --success: #10b981;
    --border-dark: #334155;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 80%);
    z-index: -1;
}

.background-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
    z-index: -1;
}

/* --- NEW HOME PAGE STYLES --- */

/* Tech Background with Blur Effect */
.tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 234, 0.15), transparent 25%);
    background-color: var(--bg-dark);
}

.tech-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 0.85rem;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Hero Section & ID Card Visual --- */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 0 5%;
    gap: 4rem;
    position: relative;
    z-index: 5;
    perspective: 1200px;
    overflow: hidden;
    /* Hide top of string */
}

.hero-left-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    /* Space for swinging */
    position: relative;
}

/* Swinging Animation Container */
.swing-container {
    transform-origin: top center;
    animation: swing 6s ease-in-out infinite;
    position: relative;
    top: -100px;
    /* Start higher so string comes from "ceiling" */
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes swing {
    0% {
        transform: rotate(5deg);
    }

    50% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(5deg);
    }
}

/* Lanyard String */
.lanyard-string {
    width: 4px;
    height: 300px;
    background: linear-gradient(90deg, #333, #555, #333);
    position: relative;
    z-index: 10;
}

.lanyard-clip {
    width: 30px;
    height: 40px;
    background: #475569;
    border-radius: 4px;
    margin-top: -5px;
    z-index: 11;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.clip-ring {
    width: 20px;
    height: 10px;
    border: 3px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-bottom: -8px;
}

/* 3D ID Card */
.id-card-3d {
    width: 300px;
    height: 460px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: 5px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    backdrop-filter: blur(10px);
}

/* Hole for clip */
.card-hole {
    width: 40px;
    height: 10px;
    background: #0f172a;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 1);
}

.card-top-bar {
    width: 100%;
    height: 60px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px 8px 0 0;
    margin-bottom: -30px;
    z-index: 0;
    opacity: 0.8;
}

.card-logo-mini {
    z-index: 2;
    background: #0f172a;
    padding: 10px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.3);
    margin-bottom: 20px;
}

.card-avatar {
    width: 120px;
    height: 120px;
    background: #1e293b;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.card-info {
    width: 100%;
    text-align: center;
}

.card-info h3 {
    margin: 0 0 20px 0;
    letter-spacing: 2px;
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
}

.info-row .label {
    color: var(--text-secondary);
}

.info-row .val {
    color: var(--text-primary);
    font-weight: bold;
}

.info-row .val.valid {
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.barcode {
    height: 40px;
    background: repeating-linear-gradient(90deg,
            #fff,
            #fff 2px,
            transparent 2px,
            transparent 4px);
    margin-top: 20px;
    opacity: 0.8;
    border-radius: 4px;
}

.hologram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.05) 45%, transparent 50%);
    pointer-events: none;
    border-radius: 16px;
    z-index: 10;
}

@media (max-width: 900px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding-top: 2rem;
    }

    .hero-left-section {
        height: 400px;
        /* Reduced swing space on mobile */
        margin-bottom: -50px;
    }

    .id-card-3d {
        width: 260px;
        height: 400px;
    }
}

/* Glassmorphism Login Card */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.glass-card {
    background: rgba(30, 41, 59, 0.6);
    /* Semi-transparent */
    backdrop-filter: blur(20px);
    /* The "Blur Image" effect */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Glow Effect inside Card */
.card-glow-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 242, 234, 0.05), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.login-header h2 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 0.5rem;
}

/* Input Fields */
.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.input-field {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0 1rem;
    transition: 0.3s;
}

.input-field:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 234, 0.1);
}

.input-icon {
    margin-right: 0.8rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.input-field input {
    background: transparent;
    border: none;
    padding: 1rem 0;
    color: white;
    width: 100%;
    font-size: 1rem;
}

.input-field input:focus {
    outline: none;
}

/* Security Footer */
.security-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--accent-primary);
    opacity: 0.8;
}

.glow-on-hover {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--accent-secondary), #00f2ea);
    color: #0f172a;
}

/* Voting Page Specifics */
.voting-page .top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dark);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.voter-info {
    font-family: monospace;
    background: rgba(0, 242, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 234, 0.2);
}

.voter-info .label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.voter-info .value-mask {
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.page-header {
    text-align: center;
    margin: 3rem 0;
}

/* --- Premium Candidate Cards --- */

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.candidate-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Brighter border for glass effect */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.candidate-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.6);
}

.candidate-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 234, 0.3), 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

/* Add a gradient overlay on select */
.candidate-card.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(45deg, var(--accent-primary), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card-content {
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Floating colored glow blob behind avatar */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 1;
    transition: opacity 0.3s;
    background: radial-gradient(circle at 50% 30%, currentColor, transparent 70%);
}

.candidate-card:hover .card-glow {
    opacity: 0.2;
}

.candidate-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    position: relative;
    /* For Pseudo-elements */
    z-index: 2;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease, border-color 0.3s;
    background: #1e293b;
}

.candidate-card:hover .candidate-avatar {
    transform: scale(1.1);
    border-color: var(--text-primary);
}

.candidate-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.candidate-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.party-name {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 2rem;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Styled Selection Button */
.selection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.candidate-card:hover .selection-status {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.status-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background: transparent;
    transition: all 0.3s;
}

.candidate-card.selected .status-circle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary);
}

.candidate-card.selected .selection-status {
    background: rgba(0, 242, 234, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.card-glow-bar {
    /* Replaces old .card-glow line */
    height: 6px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

.candidate-card.selected .status-text::after {
    content: 'ed';
}

.candidate-card:not(.selected) .status-text::after {
    content: '';
}

/* Confirmation Page */
.confirmation-page {
    justify-content: center;
    align-items: center;
}

.center-container {
    max-width: 500px;
}

.success-card {
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-soft);
}

.block-details {
    background: #0f172a;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: left;
    border: 1px solid var(--border-dark);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-family: monospace;
    color: var(--text-primary);
}

.status-verified {
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-verified::before {
    content: '•';
    font-size: 1.5rem;
    line-height: 0;
}

.ledger-note {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 2rem;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-secondary), #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.primary-btn.pulse-btn:not(:hover) {
    animation: pulse 2s infinite;
}

.huge-btn {
    padding: 1.2rem;
    font-size: 1.1rem;
}

.secondary-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.animated-entry {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success Checkmark CSS */
.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--success);
    stroke-miterlimit: 10;
    margin: 0 auto 1.5rem;
    box-shadow: inset 0px 0px 0px var(--success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 50px rgba(16, 185, 129, 0.1);
    }
}

/* Error / Already Voted Page */
.error-page {
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 100;
}

.error-card {
    position: relative;
    z-index: 101;
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
    /* Red border */
    box-shadow: 0 10px 40px -10px rgba(239, 68, 68, 0.2);
}

.error-card .icon-wrapper {
    margin-bottom: 1.5rem;
    display: inline-flex;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
}

.error-card h2 {
    color: #ef4444;
    /* Red */
    margin-bottom: 1rem;
}

.error-message-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.highlight-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.sub-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 242, 234, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Live Terminal Overlay (90% Screen) */
.live-terminal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90vw;
    height: 90vh;
    background-color: #000000;
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 234, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    font-family: 'Courier New', Courier, monospace;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-terminal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.terminal-header {
    background: #111;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.terminal-close-btn {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.terminal-close-btn:hover {
    background: #ef4444;
    color: white;
}

/* Floating Trigger Button */
.terminal-trigger-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.2);
    transition: all 0.3s ease;
}

.terminal-trigger-btn:hover {
    background: var(--accent-primary);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 242, 234, 0.4);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.terminal-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #22c55e;
    line-height: 1.4;
    font-family: 'Consolas', 'Monaco', monospace;
    scrollbar-width: thin;
    scrollbar-color: #333 #000;
}

.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: #000;
}

.terminal-content::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.log-entry {
    margin-bottom: 5px;
}

.header-log {
    color: #fff;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #555;
    padding-bottom: 5px;
}

.log-json {
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: #22c55e;
}

.log-time {
    color: #64748b;
    margin-right: 5px;
}

.log-hash {
    color: #0ea5e9;
    /* Sky blue for hash highlight */
}

/* --- How It Works Section (Diagram Flow) --- */
.how-it-works {
    padding: 6rem 5%;
    position: relative;
    z-index: 5;
    background: linear-gradient(to bottom, var(--bg-dark), #0b1120);
}

.works-header {
    text-align: center;
    margin-bottom: 5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.works-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.works-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Vertically center cards and arrows */
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.step-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
    min-width: 250px;
}

.step-card:hover {
    transform: translateY(-10px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    background: rgba(30, 41, 59, 0.6);
}

.step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-secondary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
    transition: transform 0.3s, color 0.3s, border-color 0.3s;
}

.step-card:hover .step-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--accent-primary);
    border-color: rgba(0, 242, 234, 0.3);
}

.step-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.step-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.5;
    flex-shrink: 0;
    padding: 0 1rem;
    transition: transform 0.3s;
}

.step-arrow svg {
    width: 32px;
    height: 32px;
}

/* Responsive Design for Steps */
@media (max-width: 900px) {
    .steps-container {
        flex-direction: column;
        gap: 2rem;
    }

    .step-arrow {
        transform: rotate(90deg);
        /* Point down on mobile */
        padding: 0;
    }

    .step-card {
        width: 100%;
        max-width: 500px;
    }
}


/* PDF Preview Section */
.pdf-section {
    padding: 4rem 5%;
    position: relative;
    z-index: 5;
    margin-bottom: 4rem;
}

.pdf-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, border-color 0.3s;
}

.pdf-container:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pdf-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-title svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.pdf-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.pdf-badge {
    background: rgba(0, 242, 234, 0.1);
    border: 1px solid rgba(0, 242, 234, 0.3);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: monospace;
    font-weight: 600;
}

.pdf-preview-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pdf-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pdf-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.view-btn {
    background: linear-gradient(135deg, var(--accent-secondary), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.pdf-btn svg {
    flex-shrink: 0;
}

/* Responsive Design for PDF Section */
@media (max-width: 768px) {
    .pdf-section {
        padding: 2rem 3%;
    }

    .pdf-container {
        padding: 1.5rem;
    }

    .pdf-title h2 {
        font-size: 1.4rem;
    }

    .pdf-preview-wrapper {
        height: 400px;
    }

    .pdf-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdf-actions {
        flex-direction: column;
        width: 100%;
    }

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

@media (max-width: 480px) {
    .pdf-preview-wrapper {
        height: 300px;
    }

    .pdf-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}