/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography - Using Linktree-style fonts */
body {
    font-family: 'Karla', 'Nunito', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Ensure html also has the background for overscroll */
html {
    background: var(--bg-primary);
    scroll-behavior: smooth;
}

/* Material Icons Setup */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    user-select: none;
}

/* Theme Variables */
.dark-theme {
    --bg-primary: #000000;
    --bg-secondary: #030A19;
    --bg-surface: #111827;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #374151;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --button-bg: #222222;
    --button-bg-hover: #333333;
    --shadow-color: rgba(59, 130, 246, 0.2);
    --shadow-hover: rgba(59, 130, 246, 0.3);
}

.light-theme {
    --bg-primary: #d5d5d5;
    --bg-secondary: #b5b7bb;
    --bg-surface: #cfd4dc;
    --text-primary: #1e293b;
    --text-secondary: #525f72;
    --text-muted: #737e8e;
    --border-color: #e2e8f0;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --button-bg: #222222;
    --button-bg-hover: #333333;
    --shadow-color: rgba(59, 130, 246, 0.2);
    --shadow-hover: rgba(59, 130, 246, 0.3);
}

/* Layout */
.main-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-container {
    display: flex;
    flex: 1;
    justify-content: center;
    padding: 2rem 1rem;
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
    flex-direction: column;
    align-items: center;
}

/* Profile Section */
.profile-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-image {
    height: 8rem;
    width: 8rem;
    border-radius: 50%;
    background-image: url('../CosmixLogo.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid rgba(59, 130, 246, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.profile-image::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-image:hover::after {
    opacity: 1;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px var(--shadow-hover);
}

.profile-text {
    text-align: center;
}

.profile-name {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.profile-subtitle {
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Links Section */
.links-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-button {
    display: flex;
    height: 2.75rem;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
    text-decoration: none;
    color: #ffffff;
    background: var(--button-bg);
    border-radius: 0.5rem;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    overflow: hidden;
    cursor: pointer;
    letter-spacing: 0.005em;
}

.link-button:hover {
    transform: scale(1.05);
    border-color: var(--primary-blue);
    box-shadow: 0 8px 25px var(--shadow-color);
    background: var(--button-bg-hover);
}

.link-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.link-text {
    flex-grow: 1;
    text-align: center;
    font-weight: 500;
}

.link-icon {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* Theme Toggle */
.theme-toggle {
    margin-top: 2rem;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .theme-toggle:hover {
    background-color: #d5d5d5;
    color: #1e293b;
}

.light-theme .theme-toggle:hover {
    background-color: #222222;
    color: #ffffff;
}

/* Copy icon styles */
.copy-icon {
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    font-size: 1.2rem !important;
}

.copy-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    color: var(--primary-blue);
}

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

/* Focus states for accessibility */
.link-button:focus,
.theme-toggle:focus,
.video-close-btn-inline:focus,
.copy-icon:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Responsive Design */

/* Mobile (max-width: 374px) */
@media (max-width: 374px) {
    .page-container {
        padding: 1.5rem 0.75rem;
    }

    .profile-image {
        height: 5rem;
        width: 5rem;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .link-button {
        height: 2.75rem;
        font-size: 0.8rem;
        padding: 0 0.75rem;
    }

    .link-button .material-symbols-outlined {
        font-size: 1.25rem;
    }
}

/* Small screens (375px - 474px) */
@media (min-width: 375px) and (max-width: 474px) {
    .profile-image {
        height: 6rem;
        width: 6rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .link-button {
        height: 3rem;
        font-size: 0.875rem;
    }
}

/* Extra small breakpoint (475px+) */
@media (min-width: 475px) {
    .profile-name {
        font-size: 1.875rem;
    }

    .profile-subtitle {
        font-size: 1rem;
    }
}

/* Small (640px+) */
@media (min-width: 640px) {
    .page-container {
        padding: 3rem 1.5rem;
        max-width: 28rem;
    }

    .profile-name {
        font-size: 3rem;
    }

    .link-button {
        height: 3rem;
        padding: 0 1.25rem;
        font-size: 1rem;
    }
}

/* Medium (768px+) */
@media (min-width: 768px) {
    .page-container {
        max-width: 30rem;
    }

    .profile-image {
        height: 9rem;
        width: 9rem;
    }

    .profile-name {
        font-size: 2.5rem;
    }

    .link-button {
        height: 3.25rem;
        padding: 0 1.5rem;
        font-size: 1.05rem;
    }
}

/* Large (1024px+) */
@media (min-width: 1024px) {
    .page-container {
        max-width: 32rem;
    }

    .link-button {
        height: 3.5rem;
        padding: 0 1.75rem;
        font-size: 1.1rem;
    }
}

/* Fade-in animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Animation delays */
.profile-section {
    animation-delay: 0.1s;
}

.links-section .link-button:nth-child(1) {
    animation-delay: 0.2s;
}

.links-section .link-button:nth-child(2) {
    animation-delay: 0.3s;
}

.links-section .link-button:nth-child(3) {
    animation-delay: 0.4s;
}

.links-section .link-button:nth-child(4) {
    animation-delay: 0.5s;
}

.theme-toggle {
    animation-delay: 0.7s;
}

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


/* YouTube Video Inline Styles */
.video-player-container {
    width: 100%;
    margin: 1rem 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
}

.video-player-container.expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: 450px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg-surface);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-close-btn-inline {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.75rem auto 0;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-theme .video-close-btn-inline:hover {
    background-color: #d5d5d5;
    color: #1e293b;
}

.light-theme .video-close-btn-inline:hover {
    background-color: #222222;
    color: #ffffff;
}

/* Responsive video */
@media (max-width: 768px) {
    .video-player-container.expanded {
        max-height: 300px;
    }
}

/* Calendly Widget Inline Styles */
.calendly-widget-container {
    width: 100%;
    margin: 1rem 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
}

.calendly-widget-container.expanded {
    opacity: 1;
    transform: translateY(0);
    max-height: 600px;
}

.widget-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg-surface);
}

.widget-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.widget-close-btn-inline {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.75rem auto 0;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-theme .widget-close-btn-inline:hover {
    background-color: #d5d5d5;
    color: #1e293b;
}

.light-theme .widget-close-btn-inline:hover {
    background-color: #222222;
    color: #ffffff;
}

/* Responsive Calendly widget */
@media (max-width: 768px) {
    .calendly-widget-container.expanded {
        max-height: 500px;
    }

    .widget-wrapper {
        height: 400px;
    }
}

/* Video thumbnail and play button styles */
.video-preview {
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.play-button .material-symbols-outlined {
    font-size: 1rem;
    margin-left: 1px; /* Align play icon properly */
}

/* Embedded video styles */
.embedded-video-container {
    display: block;
    width: 100%;
    margin: 1rem 0;
    text-decoration: none;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.embedded-video-container:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.embedded-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-surface);
}

.embedded-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive embedded video */
@media (max-width: 768px) {
    .embedded-video-wrapper {
        padding-bottom: 56.25%;
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .link-button:hover {
        transform: none;
        background: var(--button-bg);
    }

    .embedded-video-container:hover {
        transform: none;
    }
}