:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically */
    min-height: 100vh;
    overflow-x: hidden;
    padding: 2rem;
}

/* Admin specific overrides */
.admin-layout {
    justify-content: flex-start;
    /* Removed center vertically */
}

.nav {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

/* Admin Nav overrides */
.admin-layout .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
    /* Changed from absolute */
    top: auto;
    right: auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

.admin-layout header {
    text-align: left;
}

@media (max-width: 600px) {
    .admin-layout header {
        text-align: center;
    }
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Admin Theme Override */
/* Removed */

.logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    /* Optional: if the logo is square but we want it round-ish or just keep it square */
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.4));
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.subtitle {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.subtitle-hero {
    color: var(--text-muted);
    font-size: 2.2rem;
    font-weight: 400;
    font-family: 'Lacquer', cursive;
    letter-spacing: 0.05em;
}

.blob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.input-group {
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 16px;
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input[type="url"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    width: 100%;
}

input[type="url"]::placeholder {
    color: var(--text-muted);
}

.container {
    width: 100%;
    max-width: 800px;
    z-index: 1;
    /* Removed margin-top to allow flex centering to work better */
}

/* Response for Mobile */
@media (max-width: 600px) {
    header {
        text-align: center;
    }

    h1 {
        font-size: 2.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .input-group {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.modal-close {
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h4 {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Security Flag Styles */
.risk-high {
    color: #f87171;
    font-weight: bold;
}

.risk-low {
    color: #34d399;
    font-weight: bold;
}

.risk-unknown {
    color: #94a3b8;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Result & Copy Styles */
.result {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

.result.show {
    margin-top: 2rem;
    max-height: 600px;
    opacity: 1;
}

.result-link-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.short-link {
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    transition: all 0.2s;
    margin-top: 0;
    /* Override default */
}

.short-link:hover {
    background: rgba(59, 130, 246, 0.2);
}

.copy-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.copy-feedback {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    height: 1.2em;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-feedback.show {
    opacity: 1;
    color: #34d399;
}

/* Inline Copy Button (Admin) */
.copy-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    margin-left: 0.5rem;
    color: var(--text-muted);
    transition: all 0.2s;
    vertical-align: middle;
}

.copy-icon-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.copy-feedback-inline {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: #34d399;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 500;
}

.copy-feedback-inline.show {
    opacity: 1;
}

/* QR Code Styles */
.qr-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.qr-container.show {
    opacity: 1;
    max-height: 600px;
    /* Increased to fit larger QR + Button */
}

.qr-container img {
    border-radius: 12px;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 50%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
}


/* Shodan Link */
.shodan-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    /* Red for High Risk/Alert/Shodan */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.05);
    transition: all 0.2s;
}

.shodan-link:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-1px);
}

/* Admin Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: #1e293b;
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 16px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

th {
    color: var(--text-main);
    font-weight: 600;
}

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

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

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

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

/* .nav moved to top of file */

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--text-main);
}

/* Error Feedback Toast */
.error-feedback {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

.error-feedback.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
.app-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.6;
    letter-spacing: 0.05em;
    width: 100%;
}

/* --- New Styles for v1.2 --- */

/* Enhanced Input Spacing */
.input-group input {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    /* Increased from default */
}

/* Password Strength & Error Styles */
.password-feedback {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: left;
    width: 100%;
    padding-left: 0.5rem;
}

.password-requirements {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    font-size: 0.8rem;
    text-align: left;
    color: var(--text-muted);
}

.password-requirements li {
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements li.valid {
    color: #34d399;
}

.password-requirements li.invalid {
    color: var(--text-muted);
}

.password-requirements li::before {
    content: '•';
    font-weight: bold;
}

.password-requirements li.valid::before {
    content: '✓';
}

/* Verification Code Grid */
.verify-grid {
    display: flex;
    gap: 1.5rem;
    /* Gap between the two groups of 3 */
    justify-content: center;
    margin-bottom: 1rem;
}

.verify-group {
    display: flex;
    gap: 0.5rem;
}

.verify-input {
    width: 3rem;
    height: 3.5rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
    font-weight: bold;
    outline: none;
    transition: all 0.2s;
}

.verify-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(59, 130, 246, 0.1);
}

.email-display {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px dashed var(--border);
}