/* ZN1 Linktree Style - Independent Page */
:root {
    /* Brand & Layout Colors */
    --color-outer-bg: #4A3C31; /* Warm Dark Coffee / Taupe */
    --color-inner-bg: #EAE0D5; /* Warm Beige / ZN1 Beige */
    --color-text-dark: #2C1E16; /* Dark Coffee Text */
    --color-border: #C88E5E; /* Copper/Gold Border */
    --color-hover: rgba(200, 142, 94, 0.15); /* Subtle Hover */
    
    /* Typography */
    --font-primary: 'Tajawal', system-ui, -apple-system, sans-serif;
    
    /* Layout Variables */
    --max-width: 580px;
    --radius-btn: 28px;
    --spacing: 16px;
    
    /* Animations */
    --transition-fast: 0.2s ease-in-out;
}

/* Light Theme Toggle (Optional feature for top left button) */
body.light-theme {
    --color-outer-bg: #F5EFEB;
    --color-inner-bg: #FFFFFF;
    --color-border: #D3B89E;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--color-outer-bg);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Outer Wrapper & Container */
.outer-background {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-color: var(--color-outer-bg);
    transition: background-color var(--transition-fast);
}

.linktree-container {
    width: 100%;
    max-width: var(--max-width);
    background-color: var(--color-inner-bg);
    min-height: 100vh;
    padding: 24px 16px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    transition: background-color var(--transition-fast);
}

/* Top Actions (Menu & Share) */
.top-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    margin-bottom: 24px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(8px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--color-text-dark);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.profile-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures logo isn't distorted */
}

.profile-username {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    color: var(--color-text-dark);
}

.profile-bio {
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    color: var(--color-text-dark);
    opacity: 0.85;
}

/* Links Container */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
    margin-bottom: 40px;
}

/* Rounded Pill Buttons */
.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: transparent;
    color: var(--color-text-dark);
    text-decoration: none;
    padding: 16px 20px;
    border-radius: var(--radius-btn);
    border: 1.5px solid var(--color-border);
    font-size: 1.05rem;
    font-weight: 700;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.link-btn:hover {
    background-color: var(--color-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 142, 94, 0.15);
}

.link-btn:active {
    transform: translateY(0);
}

.link-btn .icon {
    position: absolute;
    right: 20px; /* Arabic RTL */
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-btn .text {
    text-align: center;
    width: 100%;
    padding: 0 32px; /* Make space for icon */
}

/* Social Footer */
.social-footer {
    margin-top: auto;
    padding-top: 20px;
}

.social-icon {
    display: inline-flex;
    color: var(--color-text-dark);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    opacity: 0.8;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    pointer-events: none;
}

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

/* Micro Animations for Page Load */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-header { animation: fadeUp 0.6s ease both; }
.links-container .link-btn { animation: fadeUp 0.5s ease both; }

.links-container .link-btn:nth-child(1) { animation-delay: 0.1s; }
.links-container .link-btn:nth-child(2) { animation-delay: 0.15s; }
.links-container .link-btn:nth-child(3) { animation-delay: 0.2s; }
.links-container .link-btn:nth-child(4) { animation-delay: 0.25s; }
.links-container .link-btn:nth-child(5) { animation-delay: 0.3s; }
.links-container .link-btn:nth-child(6) { animation-delay: 0.35s; }
.links-container .link-btn:nth-child(7) { animation-delay: 0.4s; }
.links-container .link-btn:nth-child(8) { animation-delay: 0.45s; }
.social-footer { animation: fadeUp 0.5s ease 0.6s both; }

/* Responsive adjustments */
@media (min-width: 581px) {
    .linktree-container {
        margin: 40px 0;
        border-radius: 24px;
        min-height: calc(100vh - 80px);
    }
}

@media (max-width: 360px) {
    .link-btn {
        padding: 14px 16px;
        font-size: 1rem;
    }
    .link-btn .icon {
        font-size: 1.1rem;
    }
}
