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

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* Utilities */
.hidden { display: none !important; }
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Typography */
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.25rem; }

/* Header */
.glass-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.2s;
}
.search-bar:focus-within {
    box-shadow: 0 0 0 2px var(--primary-color);
    border-color: transparent;
}
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    margin-left: 0.5rem;
    outline: none;
    font-size: 1rem;
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    min-width: 220px;
    z-index: 100;
}
.dropdown button {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.95rem;
}
.dropdown button:hover { background: rgba(255, 255, 255, 0.1); color: var(--primary-color); }

/* Main Content */
.card-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 7rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.wifi-card {
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: slideIn 0.3s ease-out backwards;
}
.wifi-card:active { transform: scale(0.98); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
}
.card-actions {
    display: flex;
    gap: 0.25rem;
}
.card-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.password-display {
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-family: monospace;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.pwd-text {
    letter-spacing: 2px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5), 0 4px 6px -2px rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, background 0.2s;
}
.fab:hover { background: var(--primary-hover); transform: scale(1.05) translateY(-2px); }
.fab:active { transform: scale(0.95); }
.fab .material-icons { font-size: 2rem; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important; /* Keep display to allow opacity transition before removal */
    visibility: hidden;
}
.modal-content {
    width: 100%;
    max-width: 450px;
    padding: 1.75rem;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.input-group { margin-bottom: 1.25rem; }
.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.input-group input, .input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.875rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus, .input-group textarea:focus { 
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input { padding-right: 3rem; }
.password-wrapper .icon-btn { position: absolute; right: 0.5rem; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--text-main);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    z-index: 1100;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 1;
}
.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    visibility: hidden;
    display: block !important;
}

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