:root {
    --bg-base: #0a0a0f;
    --card-bg: rgba(20, 20, 25, 0.4);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8f8fb;
    --text-secondary: #a1a1aa;
    --accent-1: #ff2a85;
    --accent-2: #8a2be2;
    --accent-3: #00e5ff;
    --error: #ff3366;
    --success: #00e676;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Aurora Background Elements */
.aurora-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
}

.aurora-blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
    border-radius: 50%;
}

.aurora-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, var(--accent-1), transparent 60%);
    animation-delay: 0s;
}

.aurora-2 {
    bottom: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--accent-2), transparent 60%);
    animation-delay: -5s;
}

.aurora-3 {
    top: 30%; left: 40%;
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, var(--accent-3), transparent 60%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10%, 15%) scale(1.1); }
    100% { transform: translate(-10%, -5%) scale(0.9); }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

/* Grid Layout */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1400px;
    position: relative;
    z-index: 1;
    perspective: 1200px; /* Enable 3D space */
}

/* API Cards with 3D & Glass Effect */
.api-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(255,255,255,0.02);
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: 0.7s;
}

.api-card:hover::before {
    left: 150%;
}

.api-card:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.3);
}

/* Card Header */
.card-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    border-bottom: 0px;
}

.card-header h2::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 10px var(--accent-3);
}

#dog-card .card-header h2::before { background: var(--accent-1); box-shadow: 0 0 10px var(--accent-1); }
#joke-card .card-header h2::before { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
#user-card .card-header h2::before { background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); }
#json-card .card-header h2::before { background: #ffaa00; box-shadow: 0 0 10px #ffaa00; }

/* Card Content Area */
.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
}

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

/* Buttons with glowing effect */
.primary-btn, .secondary-btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.8rem 1.8rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 42, 133, 0.3);
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.primary-btn:hover::after {
    opacity: 1;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.5);
}

.primary-btn:active {
    transform: translateY(1px) scale(0.98);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

/* Special Data Displays */
.dog-image-container {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.dog-image-container img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.dog-image-container:hover img {
    transform: scale(1.05);
}

.breed-badge {
    background: linear-gradient(135deg, rgba(255, 42, 133, 0.2), rgba(138, 43, 226, 0.2));
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Jokeee */
.joke-setup {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.joke-punchline {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-3), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: punchlineReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

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

/* User Profile Stats */
.user-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid transparent;
    background: linear-gradient(var(--bg-base), var(--bg-base)) padding-box, 
                linear-gradient(135deg, var(--accent-1), var(--accent-3)) border-box;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.user-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: #fff;
}

.user-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-details p {
    background: rgba(255,255,255,0.03);
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.02);
}

/* JSON Posts */
.post-list {
    list-style: none;
    text-align: left;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 10px;
}

.post-list::-webkit-scrollbar {
    width: 4px;
}
.post-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.post-list::-webkit-scrollbar-thumb {
    background: var(--accent-2);
    border-radius: 4px;
}

.post-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    transition: transform 0.2s, background 0.2s;
}

.post-item:hover {
    transform: translateX(5px);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.post-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Loading Glass Overlay */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 24px;
    z-index: 10;
}

/* Unique Loader */
.spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-1), var(--accent-2), var(--accent-3), transparent);
    animation: customSpin 1.5s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    background: var(--card-bg);
    border-radius: 50%;
}

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

/* Error */
.error-msg {
    color: var(--error);
    font-weight: 700;
    background: rgba(255, 51, 102, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed var(--error);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--success), #00b35c);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 230, 118, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
