/* Root Variables for Theming */
:root {
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-primary: #8b5cf6;
    --color-primary-hover: #7c3aed;
    --color-primary-light: rgba(139, 92, 246, 0.2);
    --color-secondary: #ec4899;
    --color-text: #f8fafc;
    --color-text-muted: #cbd5e1;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-card-bg: rgba(30, 41, 59, 0.7);
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-success: #10b981;
    --color-success-hover: #059669;

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.4);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

input, button {
    font-family: inherit;
}

/* Background animated blobs */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 15s infinite alternate;
}

.bg-shape-1 {
    width: 500px;
    height: 500px;
    background: var(--color-primary);
    top: -150px;
    right: -150px;
}

.bg-shape-2 {
    width: 400px;
    height: 400px;
    background: var(--color-secondary);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 50px) scale(1.1); }
    100% { transform: translate(-30px, 20px) scale(0.9); }
}

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, #c4b5fd, #fbcfe8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--color-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* Layout Containers */
.index-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.landing-container {
    max-width: 800px;
    width: 100%;
    padding: 4rem 3rem;
    text-align: center;
}

.app-container {
    max-width: 900px;
    margin: 3rem auto;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero Section Elements */
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

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

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

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: var(--color-success-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    background: var(--color-bg-secondary);
}

.btn:active {
    transform: translateY(1px);
}

.btn .icon {
    width: 1.25em;
    height: 1.25em;
    transition: transform 0.3s ease;
}

.pulse-hover:hover .icon {
    transform: translateX(4px);
}

/* Common App Elements */
.page-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Authentication Section */
.auth-section {
    max-width: 450px;
    margin: 0 auto;
    padding: 2.5rem;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 0.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input::placeholder {
    color: rgba(203, 213, 225, 0.6);
}

/* User Status Bar */
.user-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.user-status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-tag {
    background: var(--color-primary-light);
    color: #c4b5fd;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-family: monospace;
    font-size: 0.875rem;
}

/* Sections */
.app-section {
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

/* Groups List */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.group-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.group-info {
    flex-grow: 1;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.group-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.creator-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.625rem;
    background: rgba(236, 72, 153, 0.2);
    color: #fbcfe8;
    border-radius: var(--radius-full);
}

.group-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.group-details span strong {
    color: var(--color-text);
    font-weight: 500;
}

.group-actions {
    margin-left: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-message {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
    .group-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .group-actions {
        margin-left: 0;
        width: 100%;
    }
    .group-actions .btn {
        width: 100%;
    }
    .user-status {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
