:root {
    --bg-color: #050b14;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --insta-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.background-glow {
    position: fixed;
    top: -15vw;
    left: -10vw;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    animation: floatGlow 15s ease-in-out infinite alternate;
}

.background-glow-2 {
    position: fixed;
    bottom: -15vw;
    right: -10vw;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(220, 39, 67, 0.3) 0%, transparent 60%);
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    animation: floatGlowReverse 12s ease-in-out infinite alternate;
}

@keyframes floatGlow {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translateY(50px) scale(1.1);
        opacity: 0.5;
    }
}

@keyframes floatGlowReverse {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translateY(-50px) scale(1.2);
        opacity: 0.8;
    }
}

.container {
    max-width: 900px;
    width: 100%;
    padding: 80px 20px 60px;
    flex: 1;
    animation: fadeInUpper 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUpper {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Header */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 70px;
    opacity: 0;
    animation: fadeInUpper 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.profile-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    padding: 4px;
    background: var(--insta-gradient);
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(220, 39, 67, 0.4), 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease;
}

.profile-image:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 40px rgba(220, 39, 67, 0.6), 0 15px 30px rgba(0, 0, 0, 0.6);
}

.profile-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 35px;
    line-height: 1.7;
    font-weight: 300;
}

.insta-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1.05rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

/* Shine effect on button */
.insta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.insta-btn:hover::before {
    left: 150%;
}

.insta-btn:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(220, 39, 67, 0.2);
}

.insta-btn ion-icon {
    font-size: 1.5rem;
    color: #e6683c;
    transition: transform 0.3s ease;
}

.insta-btn:hover ion-icon {
    transform: scale(1.2);
}

/* Gallery / Posts Preview */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Staggered animation classes injected via JS */
.gallery-item.show {
    transform: translateY(0);
    opacity: 1;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: url('assets/logo-icon.png') no-repeat center;
    background-size: contain;
    opacity: 0;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.gallery-item:hover::before {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.2);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Subtle Footer / Hidden Admin Trigger */
.subtle-footer {
    padding: 20px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.admin-trigger {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.15;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 50%;
}

.admin-trigger:hover {
    opacity: 0.8;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group ion-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 48px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.error-msg {
    color: #ef4444 !important;
    font-size: 0.85rem !important;
    margin-top: -10px !important;
    margin-bottom: 15px !important;
    display: none;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.login-btn:hover {
    background: #2563eb;
}

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

/* Dashboard Overlay */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 200;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow-y: auto;
}

.dashboard-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.dashboard-container {
    max-width: 900px;
    width: 100%;
    height: max-content;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 15px;
}

.dashboard-header h2 {
    font-weight: 800;
    font-size: 2rem;
}

.dashboard-desc {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.action-btn {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.3s ease;
}

.action-btn:hover {
    background: #2563eb;
}

.add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    cursor: pointer;
    min-height: 180px;
}

.add-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.add-card ion-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.add-card h3 {
    color: var(--text-secondary);
    margin: 0;
}