/**
 * Enhanced Link in Bio - Professional Portfolio Styles
 * Modern, Beautiful, and Fully Responsive Design
 * License: MIT
 * 
 * Features:
 * - Glassmorphism Design
 * - Dark Mode Support
 * - Bilingual Support (Arabic/English)
 * - Smooth Animations and Transitions
 * - Beautiful Color Gradients
 */

/* ===== CSS VARIABLES (THEME COLORS) ===== */
:root {
    --brand-primary: #f47b20;
    --brand-secondary: #2e3192;
    --accent-color: #ff6b6b;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --info-color: #74c0fc;
    
    --bg-light: #ffffff;
    --bg-dark: #1a1a1a;
    --text-dark: #2c3e50;
    --text-light: #dddddd;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* RTL Support for Arabic */
html[dir="rtl"] {
    direction: rtl;
}

/* ===== SCROLLBAR STYLES ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2, #667eea);
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
    font-family: 'Cairo', 'Poppins', sans-serif;
}

.lang-toggle:hover {
    background: rgba(244, 123, 32, 0.95);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.lang-toggle:active {
    transform: translateY(-1px);
}

html[dir="rtl"] .lang-toggle {
    left: auto;
    right: 20px;
}

/* ===== DARK MODE ===== */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

.dark-mode .container {
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode p,
.dark-mode .link-text {
    color: var(--text-light);
}

.dark-mode .profile-img {
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .link-item {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .link-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #ffffff;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: var(--shadow-lg);
    background: rgba(244, 123, 32, 0.95);
    color: white;
}

.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd43b;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

html[dir="rtl"] .theme-toggle {
    right: auto;
    left: 20px;
}

/* ===== MAIN CONTAINER ===== */
.container {
    width: 100%;
    max-width: 520px;
    padding: 40px 30px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

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

.container:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* ===== PROFILE SECTION ===== */
.profile {
    text-align: center;
    margin-bottom: 35px;
    animation: fadeIn 0.8s ease-out;
}

/* Brand Header with Logo and Animation */
.brand-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
    gap: 0px;
    overflow: visible;
}

.brand-logo,
.brand-animation {
    max-height: 160px;
    height: 140px;
    width: auto;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    border-radius: 10px;
    overflow: hidden;
    clip-path: inset(10px 0);
}

.brand-logo:hover,
.brand-animation:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Ensure proper spacing */
.brand-logo {
    flex: 0 1 auto;
}

.brand-animation {
    flex: 0 1 auto;
}

/* Mobile adjustment for brand header */
@media (max-width: 480px) {
    .brand-header {
        max-height: 120px;
        margin-bottom: 20px;
    }
    
    .brand-logo,
    .brand-animation {
        max-height: 100px;
    }
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

h1:hover {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile > p {
    font-size: 1rem;
    color: var(--text-dark);
    opacity: 0.85;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.profile > p:hover {
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== SOCIAL SECTION ===== */
.social-section {
    margin-top: 30px;
}

.social-section > h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-weight: 600;
}

/* ===== LINKS GRID (Merged Design) ===== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    list-style: none;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.link-item i {
    font-size: 2.8rem;
    margin-bottom: 12px;
    display: block;
    transition: all 0.3s ease;
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.link-item:hover::before {
    opacity: 0.15;
}

.link-item:hover {
    transform: translateY(-12px) scale(1.05);
    border-color: rgba(244, 123, 32, 0.5);
    box-shadow: 0 15px 40px rgba(244, 123, 32, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.icon-wrapper {
    display: none;
}

.link-item:hover i {
    transform: scale(1.15) rotate(10deg);
}

/* ===== ICON COLORS ===== */
.website-link i {
    background: linear-gradient(135deg, #f47b20, #ff9f43);
}

.github-link i {
    background: linear-gradient(135deg, #333, #555);
}

.facebook-link i {
    background: linear-gradient(135deg, #1877F2, #0a66c2);
}

.instagram-link i {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.linkedin-link i {
    background: linear-gradient(135deg, #0A66C2, #0955c2);
}

.tiktok-link i {
    background: linear-gradient(135deg, #000000, #222222);
}

.youtube-link i {
    background: linear-gradient(135deg, #FF0000, #cc0000);
}

.discord-link i {
    background: linear-gradient(135deg, #7289da, #5865f2);
}

.email-link i {
    background: linear-gradient(135deg, #c71610, #f47b20);
}

.whatsapp-link i {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.google-play-link i {
    background: linear-gradient(135deg, #00C853, #0097A7);
}

.apple-link i {
    background: linear-gradient(135deg, #555555, #1c1c1e);
}

.link-text {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.link-item:hover .link-text {
    font-weight: 700;
    color: var(--brand-primary);
}

/* ===== BLOG SECTION ===== */
.blog-section {
    margin-top: 35px;
    padding-top: 35px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.blog-section h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.blog-carousel {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-item {
    min-width: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.blog-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.blog-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

.blog-item h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* ===== CAROUSEL DOTS ===== */
.carousel-dots {
    text-align: center;
    margin-top: 15px;
}

.carousel-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.carousel-dot:hover {
    background-color: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(244, 123, 32, 0.5);
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-content a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-content a:hover {
    text-decoration: underline;
    color: var(--brand-secondary);
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
}

.close:hover {
    background: rgba(244, 123, 32, 0.2);
    color: var(--brand-primary);
    transform: rotate(90deg);
}

html[dir="rtl"] .close {
    right: auto;
    left: 15px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        border-radius: 25px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .social-section > h2 {
        font-size: 1.1rem;
    }

    .links-grid {
        gap: 10px;
    }

    .link-item {
        padding: 12px 8px;
    }

    .icon-wrapper {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }

    .link-text {
        font-size: 0.8rem;
    }

    .lang-toggle,
    .theme-toggle {
        top: 15px;
        padding: 8px 15px;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px 15px;
        max-width: 95%;
    }

    h1 {
        font-size: 1.5rem;
    }

    .profile-img {
        width: 100px;
        height: 100px;
        border-width: 4px;
    }

    .profile > p {
        font-size: 0.9rem;
    }

    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .link-item {
        padding: 10px 6px;
        border-radius: 15px;
    }

    .icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        margin-bottom: 5px;
    }

    .link-text {
        font-size: 0.75rem;
    }

    .lang-toggle {
        padding: 8px 12px;
        font-size: 0.8rem;
        top: 12px;
        left: 12px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .blog-section h2 {
        font-size: 1.1rem;
    }

    .modal-content {
        padding: 20px;
        margin: 20% auto;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 20px 12px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .link-item {
        flex-direction: row;
        gap: 10px;
    }

    .icon-wrapper {
        margin-bottom: 0;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .link-item {
        border: 2px solid var(--text-dark);
    }
    
    .container {
        border: 2px solid var(--text-dark);
    }
}

/* ===== FOCUS STYLES ===== */
.link-item:focus,
.lang-toggle:focus,
.theme-toggle:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
