: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);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #334155;
    --secondary-hover: #475569;
    --error-color: #ef4444;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Container */
.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    z-index: 10;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

.card h2 i {
    color: #818cf8;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.centered-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.min-h-content {
    min-height: 150px;
}

/* Image Container */
.image-container {
    width: 100%;
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}

/* Actions */
.card-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: stretch;
}

/* Buttons */
.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn.primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

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

.btn.secondary:hover {
    background: var(--secondary-hover);
    transform: scale(1.02);
}

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

/* Loader */
.loader {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #818cf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Info Info */
.info-row {
    font-size: 0.95rem;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    text-transform: capitalize;
}

/* Error Messages */
.error-msg {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
    text-align: center;
}

/* Joke Card */
.joke-setup {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.joke-punchline {
    font-size: 1.2rem;
    color: #818cf8;
    font-weight: 800;
    animation: fadeIn 0.5s ease-up;
}

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

/* User Card */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #818cf8;
    object-fit: cover;
}

.user-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Posts List */
.posts-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

/* Scrollbar */
.posts-list::-webkit-scrollbar {
    width: 6px;
}
.posts-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.posts-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.post-item {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.post-item h4 {
    margin-bottom: 0.25rem;
    color: #cbd5e1;
}

.post-item p {
    color: var(--text-secondary);
    line-height: 1.4;
}

.placeholder {
    text-align: center;
    opacity: 0.5;
}

/* Weather Content */
.input-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.weather-info {
    text-align: center;
    margin-top: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 800;
    color: #818cf8;
    margin-bottom: 0.5rem;
}

.weather-details p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Background Decoration */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    header {
        padding: 2rem 1rem 1rem;
    }
}
