:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary-color: #818cf8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(0, 0, 0, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Mobile App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    /* Restrict width for mobile feel on desktop */
    min-height: 100dvh;
    height: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.icon-btn:hover,
.icon-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.icon-btn.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Main Converter Card */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

/* Input Groups */
.input-group {
    background: var(--input-bg);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(129, 140, 248, 0.5);
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.flag-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.currency-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-grow: 1;
    outline: none;
    padding-right: 1.5rem;
    z-index: 2;
}

.currency-select option {
    background: #1e1b4b;
    /* Solid background for dropdown options */
    color: #fff;
}

.dropdown-icon {
    position: absolute;
    right: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
}

.amount-input-wrapper input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 2.5rem;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.amount-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Hide number spin buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Readonly styling */
input[readonly] {
    color: var(--primary-color);
}

/* Swap Button */
.swap-container {
    position: relative;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    margin: -10px 0;
    /* Overlap the input groups */
}

.swap-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
    transition: all 0.3s ease;
    border: 4px solid #161536;
    /* Creates separation from inputs */
}

.swap-btn:hover,
.swap-btn:active {
    transform: scale(1.1) rotate(180deg);
}

/* Info Section */
.info-section {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.glass-pill {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.glass-pill i {
    color: var(--primary-color);
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.9);
    /* Emerald green */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.toast.show {
    bottom: 2rem;
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
    /* Red */
}

/* Background elements for depth */
.app-container::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(129, 140, 248, 0.3);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}

.app-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10%;
    width: 250px;
    height: 250px;
    background: rgba(192, 132, 252, 0.2);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
}

/* Additions to existing style.css */

.hidden {
    display: none !important;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(129, 140, 248, 0.4);
}

.error-text {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Nav Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.profile-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.nav-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Fix main app container to account for top nav */
.app-container {
    padding-top: 5rem;
}

/* Admin Panel Additions */
.app-container-admin {
    padding-top: 6rem;
}

.admin-panel {
    gap: 2rem;
}

.add-user-section h3,
.users-list-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.add-user-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-select {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    margin-bottom: 0.5rem;
}

.role-select option {
    background: #1e1b4b;
    color: #fff;
}

.shrink-btn {
    margin-top: 0;
}

.users-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 5px;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling for users list */
.users-list::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track {
    background: transparent;
}

.users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.user-item {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-role.admin-badge {
    color: #f59e0b;
}

.del-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.del-btn:hover {
    background: var(--danger);
    color: white;
}