:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #ec4899;
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* App-like feel */
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

/* Views Management */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: var(--bg-dark);
    z-index: 1;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.view.slide-up {
    transform: translateY(100%);
    opacity: 1;
    z-index: 20;
}

.view.slide-up.active {
    transform: translateY(0);
}

/* Auth View */
#auth-view {
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: transparent;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: floatIn 0.8s ease-out forwards;
}

@keyframes floatIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.5);
}

.logo-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.logo-container p {
    color: var(--text-muted);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Inputs and Buttons */
.input-field {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
}

/* Header */
.app-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.app-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Main Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    padding-bottom: 80px; /* space for scrolling */
}

/* Hero Action Button */
.hero-action {
    text-align: center;
    margin: 10px 0 30px;
}

.btn-giant {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4), inset 0 0 0 8px rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-giant::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-giant:active {
    transform: scale(0.9);
}

.btn-giant:active::after {
    opacity: 1;
}

.hero-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.hero-sub {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

/* Feed Lists & Cards */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

.time-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 12px;
}

.card-body p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.location-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 8px;
}

.location-tag .material-icons-round {
    font-size: 16px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.btn-small {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-accept {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-maybe {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-decline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.1);
    border-radius: 16px;
    border: 1px dashed var(--border);
}

.empty-state .material-icons-round {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 8px;
}

/* Forms */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

textarea.input-field {
    resize: none;
    font-family: inherit;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Radio Cards (Level Selector) */
.level-selector {
    display: flex;
    gap: 8px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.card-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    text-align: center;
}

.radio-card input:checked + .card-content {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

/* Group Selection List */
.group-selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-select-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.group-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.checkbox-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-custom input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.group-select-level {
    padding-left: 26px;
}

.group-select-level select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Add Group Form */
.add-group-form {
    display: flex;
    gap: 8px;
}

/* List Items (Friends/Groups) */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-details h4 {
    font-size: 1rem;
    font-weight: 600;
}

.item-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.toast.show {
    bottom: 30px;
}
