/* ===== ROOT & RESET ===== */
:root {
    --primary: #5B7FFF;
    --primary-dark: #4A6AE6;
    --primary-light: #7A9BFF;
    --secondary: #FF6B9D;
    --success: #2DD4BF;
    --warning: #FDB022;
    --danger: #EF4444;

    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #F8F9FD;
    --bg-card: #FFFFFF;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;

    --border: #E5E7EB;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);

    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== CONTAINER ===== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== HEADER ===== */
.header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

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

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

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

.inline-form {
    display: inline-flex;
    align-items: center;
}

/* ===== MAIN CONTENT ===== */
main {
    flex: 1;
    padding: 2rem 0;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ===== FORMS ===== */
form {
    max-width: 450px;
    margin: 2rem 0;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-card);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== BUTTONS ===== */
button,
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

button[type="submit"],
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

button[type="submit"]:hover,
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #DC2626;
}

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

.btn-success:hover {
    background: #14B8A6;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card h3 {
    margin-top: 0;
    color: var(--primary);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* ===== APP LIST ===== */
.app-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.app-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.app-item a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.125rem;
}

.app-item a:hover {
    color: var(--primary-dark);
}

.app-platform {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== USER STATS ===== */
.user-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-gradient);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 1;
    min-width: 150px;
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    opacity: 0.9;
    color: white;
    -webkit-text-fill-color: white;
    background: none;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #DBEAFE;
    border-color: #3B82F6;
    color: #1E40AF;
}

.alert-success {
    background: #D1FAE5;
    border-color: var(--success);
    color: #065F46;
}

.alert-warning {
    background: #FEF3C7;
    border-color: var(--warning);
    color: #92400E;
}

.alert-danger {
    background: #FEE2E2;
    border-color: var(--danger);
    color: #991B1B;
}

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

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

.badge-warning {
    background: var(--warning);
    color: white;
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex {
    display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .app-list,
    .card-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }
}
