/* Layout Components - Shared across all views */

/* Hero Section */
.hero-section {
    background: var(--purple-dark);
    color: white;
    padding: 3rem 0 4rem 0;
    margin: 0 -15px 3rem -15px;
    position: relative;
    overflow: visible; /* Allow dropdowns to extend beyond hero section */
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: -2rem;
    z-index: 1;
    min-height: 180px;
    /* Fix for faint square corners - comprehensive approach */
    border: none;
    outline: none;
    /* Force hardware acceleration for smoother rendering */
    transform: translateZ(0);
    will-change: transform;
    /* Ensure anti-aliasing for smooth corners */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Additional fixes for clean corners */
    isolation: isolate;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-sizing: border-box;
}

/* Add gradient background as a pseudo-element to avoid border-radius artifacts */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--purple-dark);
    border-radius: inherit;
    z-index: 0;
    overflow: hidden; /* Ensure background respects border radius */
}

/* Landing page specific hero styling - fully rounded with top spacing */
body.landing-page .hero-section {
    margin: 2rem -15px 3rem -15px; /* Add more top margin for better spacing from top */
    border-radius: 2rem; /* All corners rounded */
    margin-top: 1rem; /* Add positive margin to detach from top */
}

/* Add bottom spacing for all pages with page-content class */
main.page-content {
    padding-bottom: 4rem; /* Add space between content and footer */
}

/* Hero content positioning */
.hero-content {
    position: relative;
    z-index: 2; /* Higher than decorative elements but not too high */
    height: 100%;
    /* Allow content to extend beyond hero section for dropdowns */
    overflow: visible;
}

/* Fixed position panel doesn't need hero section specific rules */

/* Global floating user panel - completely independent of page content */
.user-dropdown-corner {
    position: fixed !important;
    top: 1rem !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 2147483647 !important; /* Maximum possible z-index */
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 2rem 0 0 2rem !important;
    padding: 0.5rem !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.2) !important;
    width: 58px !important; /* 20% bigger - was 48px */
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    transform: none !important;
    /* Force independence from any parent containers */
    float: none !important;
    clear: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Expanded state on hover */
.user-dropdown-corner:hover {
    width: auto !important;
    min-width: 240px !important; /* 20% bigger - was 200px */
    right: 1rem !important; /* Move away from edge when expanded */
    border-radius: 2rem !important; /* Full rounded corners when expanded */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    justify-content: flex-start !important; /* Left align when expanded */
}

/* Ensure dropdown container creates proper stacking context */
.user-dropdown-corner .dropdown {
    position: relative; /* Create positioning context for dropdown menu */
    z-index: inherit;
    width: 100%; /* Full width of parent */
    flex: none; /* Prevent flex expansion */
}

.user-dropdown-toggle {
    cursor: pointer;
    padding: 0;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    color: white;
    width: 100%;
    justify-content: center; /* Center content in minimized state */
}

/* Expanded state - change alignment */
.user-dropdown-corner:hover .user-dropdown-toggle {
    justify-content: flex-start;
    padding: 0.5rem;
}

/* Minimized state - hide text and chevron */
.user-dropdown-corner .user-dropdown-toggle .username-text,
.user-dropdown-corner .user-dropdown-toggle .chevron-icon {
    opacity: 0;
    width: 0;
    margin: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Hide chevron completely - we don't want it */
.user-dropdown-corner .user-dropdown-toggle .chevron-icon {
    display: none !important;
}

/* Expanded state on hover - show text only (no chevron) */
.user-dropdown-corner:hover .user-dropdown-toggle .username-text {
    opacity: 1;
    width: auto;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

/* Show dropdown on hover instead of click - Global application */
.user-dropdown-corner:hover .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important; /* Maintain centering while animating */
    animation: dropdownFadeIn 0.4s ease forwards !important;
    animation-delay: 0.1s !important;
}

/* Ensure dropdown is initially hidden but ready to show */
.user-dropdown-corner .dropdown-menu {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure dropdown items are always visible when dropdown is shown */
.user-dropdown-corner .dropdown-menu li {
    opacity: 1 !important;
    visibility: visible !important;
    display: list-item !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.user-dropdown-corner .dropdown-item {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Simple hover state without complex animations as fallback */
.user-dropdown-corner:hover .dropdown-menu li,
.user-dropdown-corner:hover .dropdown-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Simplified dropdown item animation - ensure visibility first */
.user-dropdown-corner:hover .dropdown-menu li {
    opacity: 1 !important;
    transform: translateX(0) !important;
    animation: dropdownItemFadeIn 0.2s ease forwards !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(1) {
    animation-delay: 0.05s !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(2) {
    animation-delay: 0.1s !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(3) {
    animation-delay: 0.15s !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(4) {
    animation-delay: 0.2s !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(5) {
    animation-delay: 0.25s !important;
}

.user-dropdown-corner:hover .dropdown-menu li:nth-child(6) {
    animation-delay: 0.3s !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
        visibility: hidden;
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        visibility: visible;
    }
}

@keyframes dropdownItemFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* JavaScript will move the panel to body level - ensure it works there */
body > .user-dropdown-corner {
    position: fixed !important;
    top: 1rem !important;
    right: 0 !important;
    z-index: 2147483647 !important;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main hero content with proper spacing */
.hero-main-content {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

/* Center content on landing page */
body.landing-page .hero-main-content {
    text-align: center;
}

/* Dashboard page title spacing */
body.dashboard-page .hero-main-content {
    padding-left: 2rem; /* Add left padding for dashboard title */
}

/* Consolidated dropdown styling */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 0.5rem;
    z-index: var(--z-dropdown-high);
}

/* Floating panel dropdown menu - Global positioning */
.user-dropdown-corner .dropdown-menu {
    background: rgba(15, 23, 42, 0.85) !important; /* Dark slate with more transparency */
    backdrop-filter: blur(20px) saturate(180%) !important; /* Enhanced blur with saturation */
    border: 1px solid rgba(148, 163, 184, 0.3) !important; /* Lighter border */
    border-radius: 1rem !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) !important; /* Dual shadow with inner glow */
    margin-top: 0.25rem !important; /* Reduced gap to make it feel attached */
    min-width: 180px !important;
    max-width: 220px !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important; /* Center horizontally */
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important; /* Center the dropdown */
    z-index: 2147483647 !important; /* Maximum z-index */
    display: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    clear: none !important;
    overflow: hidden !important; /* Contain hover effects */
    padding: 0.5rem !important; /* Consistent padding */
    box-sizing: border-box !important;
}

.user-dropdown-corner .dropdown-item {
    color: rgba(226, 232, 240, 0.95) !important; /* Slightly warmer white */
    padding: 0.75rem 1rem !important;
    transition: all 0.2s ease !important;
    border-radius: 0.5rem !important;
    margin: 0.125rem 0.25rem !important; /* Consistent vertical spacing */
    height: auto !important;
    min-height: 44px !important; /* Standardized minimum height */
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    border: none !important;
    background: transparent !important;
    width: calc(100% - 0.5rem) !important; /* Account for margins */
    box-sizing: border-box !important;
}

.user-dropdown-corner .dropdown-item:hover {
    background-color: rgba(99, 102, 241, 0.2) !important; /* Indigo hover with transparency */
    color: rgba(255, 255, 255, 1) !important;
    transform: none !important; /* Remove slide effect to keep hover contained */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.user-dropdown-corner .dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.98) !important;
}

/* Ensure dropdown menu has proper list structure */
.user-dropdown-corner .dropdown-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Focus states for accessibility */
.user-dropdown-corner .dropdown-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3) !important;
    outline-offset: -2px !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Add a subtle connector between flyout and dropdown */
.user-dropdown-corner .dropdown-menu::before {
    content: '' !important;
    position: absolute !important;
    top: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    border-bottom: none !important;
    border-right: none !important;
    border-radius: 2px 0 0 0 !important;
    transform: translateX(-50%) rotate(45deg) !important;
    z-index: -1 !important;
}

/* Remove duplicate rule - positioning is handled above */

/* Ensure dropdown container creates proper stacking context */
.user-dropdown-corner .dropdown {
    position: relative; /* Create positioning context for dropdown menu */
    z-index: inherit;
    width: 100%; /* Full width of parent */
    flex: none; /* Prevent flex expansion */
}

.dropdown-item {
    color: #333;
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* User avatar styling for floating panel */
.user-avatar {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 38px; /* 20% bigger - was 32px */
    height: 38px; /* 20% bigger - was 32px */
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.user-dropdown-corner:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

/* Default user icon styling when no avatar */
.user-dropdown-corner .fas.fa-user-circle {
    font-size: 2.4rem; /* 20% bigger - was 2rem */
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.user-dropdown-corner:hover .fas.fa-user-circle {
    color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

/* Hero section decorative elements - combined with background */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.6;
    z-index: -1; /* Move decorative elements behind everything */
    border-radius: inherit;
    pointer-events: none;
    overflow: hidden; /* Ensure decorative elements respect border radius */
}

/* Guild Cards - using utility classes */
.guild-card {
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.guild-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.guild-card:hover::before {
    left: 100%;
}

.guild-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.guild-icon {
    width: var(--icon-lg);
    height: var(--icon-lg);
    border-radius: 50%;
    border: 4px solid transparent;
    background: var(--primary-gradient);
    padding: 2px;
    transition: var(--transition);
}

.guild-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.guild-card:hover .guild-icon {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Group Selection Cards - using utility classes and variables */
.group-selection-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.group-selection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.group-selection-card:hover::before {
    left: 100%;
}

.group-selection-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: #667eea;
}

.group-icon-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.group-stats {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.group-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.group-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: var(--transition);
}

.group-selection-card:hover .group-name {
    color: #667eea;
}

.group-selection-card:hover .group-description {
    color: var(--text-primary);
}

.group-selection-card:hover .group-arrow {
    color: #667eea;
    transform: translateX(5px);
}

/* Footer */
footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

footer .text-muted {
    color: var(--text-muted) !important;
}

/* Scrollable containers */
.scrollable-items-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
}

.scrollable-items-container:hover {
    border-color: #667eea;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .feature-icon {
    opacity: 0.6;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* Quick actions grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 3rem 0;
        margin: 0 -15px 2rem -15px;
        border-radius: 0 0 1.5rem 1.5rem;
        min-height: 160px;
    }

    .hero-main-content {
        padding-top: 1.5rem;
    }

    /* Floating panel responsive adjustments */
    .user-dropdown-corner {
        top: 0.75rem !important;
        right: 0 !important; /* Still anchor to screen edge */
        width: 50px !important; /* Proportionally smaller on mobile but still bigger than original */
    }

    .user-dropdown-corner:hover {
        min-width: 200px !important; /* Proportionally smaller expanded width on mobile */
        right: 0.75rem !important; /* Move away from edge when expanded */
    }

    .guild-icon {
        width: 60px;
        height: 60px;
    }

    .group-selection-card {
        padding: 1rem;
    }

    .group-icon-large {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1.5rem 0 2.5rem 0;
        margin: 0 -15px 1.5rem -15px;
        border-radius: 0 0 1rem 1rem;
        min-height: 140px;
    }

    .hero-main-content {
        padding-top: 1rem;
    }

    /* Extra small screens - floating panel adjustments */
    .user-dropdown-corner {
        top: 0.5rem !important;
        right: 0 !important; /* Still anchor to screen edge */
        width: 46px !important; /* Proportionally smaller on very small screens but still bigger than original */
    }

    .user-dropdown-corner:hover {
        min-width: 180px !important; /* Proportionally smaller expanded width on very small screens */
        right: 0.5rem !important; /* Move away from edge when expanded */
    }

    .group-selection-card {
        padding: 0.75rem;
    }

    .scrollable-items-container {
        max-height: 300px;
        padding: 0.75rem;
    }
} 