/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #2d1b3d 50%, #1a0a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: #e0e0e0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #330033;
    border-top: 4px solid #cc6699;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Creepster', cursive;
    font-size: 1.5rem;
    color: #cc6699;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Error Screen */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0000 0%, #2d1b1b 50%, #1a0a0a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.error-content {
    text-align: center;
    padding: 2rem;
    background: rgba(51, 0, 0, 0.3);
    border: 2px solid #660000;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.error-title {
    font-family: 'Nosifer', cursive;
    font-size: 2rem;
    color: #ff4444;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.error-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #e0e0e0;
}

.retry-button {
    background: linear-gradient(135deg, #660000 0%, #990000 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.retry-button:hover {
    background: linear-gradient(135deg, #990000 0%, #cc0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(153, 0, 0, 0.4);
}

/* Hidden Class */
.hidden {
    display: none;
}

/* Main App */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b3d 100%);
    border-bottom: 3px solid #660033;
    box-shadow: 0 2px 10px rgba(102, 0, 51, 0.5);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.title-main {
    font-family: 'Creepster', cursive;
    font-size: 2.5rem;
    color: #cc6699;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.title-subtitle {
    font-family: 'Butcherman', cursive;
    font-size: 0.9rem;
    color: #9966cc;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-decoration {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    border: 2px solid #330033;
    border-radius: 8px;
    margin: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(51, 0, 51, 0.4);
    touch-action: none;
}

/* Map Info */
.map-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 100;
    pointer-events: none;
}

.info-text {
    background: rgba(26, 10, 26, 0.9);
    color: #cc6699;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-align: center;
    font-style: italic;
    border: 1px solid #660033;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

/* Mapbox Control Customization */
.mapboxgl-ctrl-group {
    background: rgba(26, 10, 26, 0.95) !important;
    border: 1px solid #660033 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 10px rgba(51, 0, 51, 0.4) !important;
}

.mapboxgl-ctrl-group button {
    background: rgba(26, 10, 26, 0.95) !important;
    border: none !important;
    color: #cc6699 !important;
}

.mapboxgl-ctrl-group button:hover {
    background: rgba(51, 0, 51, 0.9) !important;
    color: #ff99cc !important;
}

.mapboxgl-ctrl-compass .mapboxgl-ctrl-compass-arrow {
    border-top-color: #cc6699 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .title-main {
        font-size: 2rem;
    }
    
    .title-subtitle {
        font-size: 0.8rem;
    }
    
    .map-container {
        margin: 0.5rem;
        border-radius: 6px;
    }
    
    .info-text {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .loading-text {
        font-size: 1.2rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem;
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
    
    .title-main {
        font-size: 1.5rem;
    }
    
    .title-subtitle {
        font-size: 0.7rem;
    }
    
    .search-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .location-filter,
    .clear-search-button {
        width: 100%;
    }
    
    .clear-search-button {
        height: 35px;
        border-radius: 8px;
        width: auto;
        padding: 0 1rem;
    }
    
    .clear-icon {
        margin-right: 0.5rem;
    }
    
    .map-container {
        margin: 0.25rem;
    }
    
    .profile-button,
    .logout-button {
        width: 35px;
        height: 35px;
    }
    
    .profile-icon {
        font-size: 16px;
    }
    
    .logout-icon {
        font-size: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .title-main {
        color: #ffffff;
    }
    
    .title-subtitle {
        color: #cccccc;
    }
    
    .info-text {
        background: rgba(0, 0, 0, 0.9);
        color: #ffffff;
    }
}

/* Ghost Marker Animations */
@keyframes ghostFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(1deg); }
    50% { transform: translateY(-3px) rotate(0deg); }
    75% { transform: translateY(-7px) rotate(-1deg); }
}

/* Haunted Location Popup Styling */
.haunted-location-popup .mapboxgl-popup-content {
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b3d 100%) !important;
    border: 2px solid #660033 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(102, 0, 51, 0.6) !important;
    color: #e0e0e0 !important;
    max-width: 400px !important;
    padding: 0 !important;
}

.haunted-location-popup .mapboxgl-popup-tip {
    border-top-color: #660033 !important;
}

.haunted-popup {
    font-family: 'Arial', sans-serif;
    color: #e0e0e0;
}

.popup-header {
    background: linear-gradient(135deg, #660033 0%, #990066 100%);
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #cc6699;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-family: 'Creepster', cursive;
    font-size: 1.4rem;
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.popup-type {
    background: rgba(0, 0, 0, 0.3);
    color: #cc6699;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
    border: 1px solid #cc6699;
}

.popup-content {
    padding: 1rem;
}

.popup-description {
    font-style: italic;
    color: #cc6699;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.4;
}

.popup-details {
    margin-bottom: 1rem;
}

.detail-row {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.detail-row strong {
    color: #9966cc;
    display: inline-block;
    min-width: 100px;
}

.popup-history {
    border-top: 1px solid #660033;
    padding-top: 1rem;
}

.popup-history h4 {
    font-family: 'Butcherman', cursive;
    color: #cc6699;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.popup-history p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #cccccc;
    text-align: justify;
}

/* Ghost Marker Styling */
.ghost-marker {
    position: relative !important;
    z-index: 10;
    pointer-events: auto !important;
}

.ghost-marker:hover {
    z-index: 1000 !important;
}

/* Ensure mapbox markers are positioned correctly */
.mapboxgl-marker {
    position: absolute !important;
    pointer-events: auto !important;
}

/* Popup close button styling */
.haunted-location-popup .mapboxgl-popup-close-button {
    color: #cc6699 !important;
    font-size: 20px !important;
    font-weight: bold !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
    width: 25px !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 5px !important;
    transition: all 0.3s ease !important;
}

.haunted-location-popup .mapboxgl-popup-close-button:hover {
    background: rgba(102, 0, 51, 0.6) !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
}

/* Responsive popup styling */
@media (max-width: 768px) {
    .haunted-location-popup .mapboxgl-popup-content {
        max-width: 90vw !important;
        margin: 10px !important;
    }
    
    .popup-header {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .popup-title {
        font-size: 1.2rem;
    }
    
    .popup-content {
        padding: 0.75rem;
    }
    
    .popup-description {
        font-size: 0.9rem;
    }
    
    .detail-row {
        font-size: 0.8rem;
    }
    
    .detail-row strong {
        min-width: auto;
        display: block;
        margin-bottom: 0.2rem;
    }
    
    .popup-history p {
        font-size: 0.8rem;
    }
}

/* Place Card Modal Styling */
.place-card-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.place-card-modal.show {
    opacity: 1;
    visibility: visible;
}

.place-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.place-card {
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b3d 100%);
    border: 3px solid #660033;
    border-radius: 15px;
    max-width: 600px;
    max-height: 90vh;
    width: 100%;
    position: relative;
    z-index: 10001;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(102, 0, 51, 0.6);
    transform: translateY(50px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.place-card-modal.show .place-card {
    transform: translateY(0) scale(1);
}

.place-card-header {
    background: linear-gradient(135deg, #660033 0%, #990066 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #cc6699;
}

.place-card-title {
    font-family: 'Creepster', cursive;
    font-size: 1.8rem;
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.place-card-close {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #cc6699;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #cc6699;
    cursor: pointer;
    transition: all 0.3s ease;
}

.place-card-close:hover {
    background: rgba(102, 0, 51, 0.6);
    color: #ffffff;
    transform: scale(1.1);
}

.place-card-content {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 2rem;
}

.place-card-image-container {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
}

.place-card-image {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: 2px solid #cc6699;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.5rem;
    line-height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
}

.carousel-arrow:hover {
    background: rgba(102, 0, 51, 0.9);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 15px rgba(204, 102, 153, 0.6);
}

.carousel-arrow-left {
    left: 10px;
    padding-right: 2px;
}

.carousel-arrow-right {
    right: 10px;
    padding-left: 2px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid #cc6699;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: #cc6699;
    transform: scale(1.2);
}

.carousel-indicator:hover {
    background: rgba(204, 102, 153, 0.8);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #330033 0%, #660066 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed #cc6699;
    border-radius: 10px;
}

.image-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: ghostFloat 3s ease-in-out infinite;
}

.image-placeholder p {
    color: #cc6699;
    font-style: italic;
    margin: 0;
}

.place-card-badge {
    display: inline-block;
    background: rgba(102, 0, 51, 0.8);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid #cc6699;
}

.place-card-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.place-card-section {
    margin-bottom: 1.5rem;
    border: 1px solid #660033;
    border-radius: 8px;
    overflow: hidden;
}

.section-toggle {
    width: 100%;
    background: linear-gradient(135deg, #330033 0%, #660066 100%);
    border: none;
    padding: 1rem 1.5rem;
    color: #cc6699;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.section-toggle:hover {
    background: linear-gradient(135deg, #660066 0%, #990099 100%);
    color: #ffffff;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.section-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.section-content {
    background: rgba(26, 10, 26, 0.5);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    opacity: 0;
}

.section-content.show {
    padding: 1.5rem;
    max-height: 1000px;
    overflow-y: auto;
    opacity: 1;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.2s ease 0.2s;
}

.visiting-info {
    color: #e0e0e0;
}

.history-text {
    color: #e0e0e0;
    line-height: 1.6;
}

.history-text p {
    margin-bottom: 1rem;
}

.history-text br {
    margin-bottom: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #660033;
}

.info-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-weight: bold;
    color: #9966cc;
}

.info-value {
    color: #e0e0e0;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.place-card-details {
    background: rgba(51, 0, 51, 0.3);
    border: 1px solid #660033;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: bold;
    color: #9966cc;
}

.detail-value {
    color: #e0e0e0;
}

.favourites-button {
    width: 100%;
    background: linear-gradient(135deg, #660000 0%, #990033 100%);
    border: 2px solid #cc6699;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.favourites-button:hover {
    background: linear-gradient(135deg, #990033 0%, #cc0066 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(153, 0, 51, 0.4);
}

.favourites-button.favourited {
    background: linear-gradient(135deg, #cc0066 0%, #ff0099 100%);
}

.heart-icon {
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.favourites-button.favourited .heart-icon {
    color: #ff6699;
}

/* Responsive Design for Place Cards */
@media (max-width: 768px) {
    .place-card {
        margin: 0.5rem;
        max-height: 75vh;
    }
    
    .place-card-header {
        padding: 1rem 1.5rem;
    }
    
    .place-card-title {
        font-size: 1.4rem;
    }
    
    .place-card-content {
        padding: 1.5rem;
        max-height: calc(75vh - 100px);
    }
    
    .place-card-image {
        height: 180px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .info-value {
        text-align: left;
        margin-left: 0;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .place-card-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .place-card {
        max-height: 65vh;
        max-height: calc(65vh - env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
        margin-bottom: 0;
        width: 100%;
    }
    
    .place-card-header {
        padding: 1.2rem 1rem 1rem 1rem;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .place-card-title {
        font-size: 1.4rem;
        line-height: 1.3;
        flex: 1;
        word-wrap: break-word;
        max-width: calc(100% - 50px);
    }
    
    .place-card-close {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
        flex-shrink: 0;
        margin-top: -2px;
    }
    
    .place-card-content {
        padding: 1rem;
        max-height: calc(65vh - 90px);
        max-height: calc(65vh - 90px - env(safe-area-inset-bottom));
    }
    
    .place-card-image {
        height: 150px;
        margin-bottom: 1rem;
    }
    
    .place-card-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .place-card-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .carousel-arrow {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }
    
    .favourites-button {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner,
    .ghost-icon,
    .ghost-marker,
    .image-icon {
        animation: none;
    }
    
    .retry-button:hover {
        transform: none;
    }
    
    .ghost-marker:hover {
        transform: none !important;
    }
    
    .place-card {
        transform: none;
        transition: opacity 0.3s ease;
    }
    
    .place-card-modal.show .place-card {
        transform: none;
    }
    
    .favourites-button:hover {
        transform: none;
    }
}


/* Profile Button */
.profile-button {
    background: rgba(107, 30, 107, 0.8);
    border: 2px solid #b19cd9;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-button:hover {
    background: rgba(107, 30, 107, 1);
    border-color: #ffffff;
    transform: scale(1.1);
}

.profile-icon {
    font-size: 22px;
    color: #ffffff;
}

.profile-button-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Profile Page */
.profile-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b2d 50%, #1a0a1a 100%);
    z-index: 2000;
    overflow-y: auto;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.profile-page.hidden {
    opacity: 0;
    visibility: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.back-button-container {
    display: flex;
    justify-content: center;
    padding: 1rem 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #6B1E6B;
}

.back-button {
    background: rgba(107, 30, 107, 0.8);
    border: 2px solid #b19cd9;
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.back-button:hover {
    background: rgba(107, 30, 107, 1);
    border-color: #ffffff;
    transform: scale(1.05);
}

.back-icon {
    font-size: 18px;
}

.back-text {
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.3px;
}

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

.profile-title-main {
    display: block;
    font-family: "Creepster", cursive;
    font-size: 2.5rem;
    color: #ffffff;
    text-shadow: 0 0 20px #6B1E6B;
    margin-bottom: 0.5rem;
}

.profile-title-subtitle {
    display: block;
    font-family: "Nosifer", cursive;
    font-size: 1rem;
    color: #b19cd9;
    letter-spacing: 2px;
}

.profile-decoration {
    position: absolute;
    right: 2rem;
    display: flex;
    justify-content: center;
}

.profile-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* User Info Section */
.user-info-section {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #6B1E6B;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(107, 30, 107, 0.3);
}

.user-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #6B1E6B, #b19cd9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 2rem;
    box-shadow: 0 0 30px rgba(107, 30, 107, 0.5);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(107, 30, 107, 0.7);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-avatar:hover .upload-overlay {
    opacity: 1;
}

.upload-icon {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.upload-text {
    color: #ffffff;
    font-size: 0.9rem;
    font-family: 'Butcherman', cursive;
    text-align: center;
}

.avatar-icon {
    font-size: 4rem;
    color: #ffffff;
}

.user-details {
    flex: 1;
}

.name-input-container {
    margin-bottom: 2rem;
}

.name-label {
    display: block;
    font-family: "Butcherman", cursive;
    font-size: 1.2rem;
    color: #b19cd9;
    margin-bottom: 0.5rem;
}

.name-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #6B1E6B;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1.1rem;
    font-family: "Arial", sans-serif;
    transition: all 0.3s ease;
}

.name-input:focus {
    outline: none;
    border-color: #b19cd9;
    box-shadow: 0 0 15px rgba(107, 30, 107, 0.5);
}

.name-input::placeholder {
    color: #666;
}

.user-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: "Eater", cursive;
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 0 0 15px #6B1E6B;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-family: "Butcherman", cursive;
    font-size: 1rem;
    color: #b19cd9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Favourites Section */
.favourites-section {
    margin-top: 3rem;
}

.section-title {
    display: flex;
    align-items: center;
    font-family: "Creepster", cursive;
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 0 15px #6B1E6B;
    margin-bottom: 2rem;
}

.title-icon {
    margin-right: 1rem;
    font-size: 2.5rem;
}

.favourites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.empty-favourites {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed #6B1E6B;
    border-radius: 15px;
}

.empty-icon {
    display: block;
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-text {
    font-family: "Butcherman", cursive;
    font-size: 1.3rem;
    color: #b19cd9;
    margin-bottom: 0.5rem;
}

.empty-subtext {
    color: #888;
    font-size: 1rem;
}

.favourite-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #6B1E6B;
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.favourite-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(107, 30, 107, 0.4);
    border-color: #b19cd9;
}

.favourite-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6B1E6B, #b19cd9, #6B1E6B);
}

.favourite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.favourite-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.favourite-name {
    font-family: "Butcherman", cursive;
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0;
    flex: 1;
}

.favourite-type {
    background: rgba(107, 30, 107, 0.8);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.favourite-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.visited-checkbox {
    display: flex;
    align-items: center;
    color: #b19cd9;
    cursor: pointer;
    transition: color 0.3s ease;
}

.visited-checkbox:hover {
    color: #ffffff;
}

.visited-checkbox input {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.remove-button {
    background: rgba(139, 0, 0, 0.8);
    border: 1px solid #ff4444;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.remove-button:hover {
    background: rgba(139, 0, 0, 1);
    transform: scale(1.05);
}

/* Profile Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .profile-decoration {
        right: 1rem;
    }
    
    .profile-title-main {
        font-size: 2rem;
    }
    
    .back-button-container {
        padding: 0.75rem 1rem 1rem;
    }
    
    .profile-content {
        padding: 1rem;
    }
    
    .user-info-section {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .user-stats {
        justify-content: center;
        gap: 2rem;
    }
    
    .favourites-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-button {
        width: 40px;
        height: 40px;
    }
    
    .profile-icon {
        font-size: 20px;
    }
}

/* Search Section */
.search-section {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.search-input-container {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #6B1E6B;
    border-radius: 25px;
    color: #ffffff;
    font-size: 1rem;
    font-family: "Arial", sans-serif;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #b19cd9;
    box-shadow: 0 0 15px rgba(107, 30, 107, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.search-input::placeholder {
    color: #888;
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #b19cd9;
    pointer-events: none;
}

.location-filter {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #6B1E6B;
    border-radius: 25px;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: "Butcherman", cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.location-filter:focus {
    outline: none;
    border-color: #b19cd9;
    box-shadow: 0 0 15px rgba(107, 30, 107, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.location-filter option {
    background: #1a0a1a;
    color: #ffffff;
    padding: 0.5rem;
}

.clear-search-button {
    background: rgba(139, 0, 0, 0.8);
    border: 2px solid #ff4444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-search-button:hover {
    background: rgba(139, 0, 0, 1);
    border-color: #ffffff;
    transform: scale(1.1);
}

.clear-icon {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: bold;
}

.search-results-info {
    text-align: center;
    color: #b19cd9;
    font-family: "Butcherman", cursive;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.search-results-info.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Search Mobile Responsiveness */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        align-items: stretch;
    }
    
    /* Title and user controls on same line */
    .title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .title-main {
        font-size: 1.6rem;
        flex: 1;
        text-align: left;
    }
    
    .title-subtitle {
        font-size: 0.7rem;
        display: none; /* Hide subtitle on mobile to save space */
    }
    
    .header-decoration {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    /* Search section takes full width below */
    .search-section {
        width: 100%;
        margin: 0;
    }
    
    .search-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Type filter dropdown full width on top */
    .location-filter {
        width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        order: -1; /* Move to top of search controls */
    }
    
    /* Search input container below */
    .search-input-container {
        width: 100%;
    }
    
    .search-input {
        padding: 0.7rem 2.5rem 0.7rem 1rem;
        font-size: 0.95rem;
    }
    
    .clear-search-button {
        width: 35px;
        height: 35px;
    }
    
    .profile-button,
    .logout-button {
        width: 40px;
        height: 40px;
    }
    
    .profile-icon {
        font-size: 18px;
    }
    
    .logout-icon {
        font-size: 1.1rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .title-main {
        font-size: 1.4rem;
    }
    
    .location-filter,
    .search-input {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .profile-button,
    .logout-button {
        width: 36px;
        height: 36px;
    }
}

/* Authentication Screen */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d1b36 0%, #1a0a1a 50%, #2d1b36 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50000;
    animation: fadeIn 0.5s ease-in;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

.auth-content {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #6B1E6B;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: min(92vw, 480px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(107, 30, 107, 0.5);
    text-align: center;
    margin: auto;
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-title {
    margin: 0 0 1rem 0;
}

.auth-main {
    display: block;
    font-family: "Creepster", cursive;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #b19cd9;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(177, 156, 217, 0.5);
    line-height: 1.2;
}

.auth-subtitle {
    display: block;
    font-family: "Nosifer", cursive;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #ff6b6b;
    font-weight: 400;
    line-height: 1.3;
}

.auth-ghost {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-top: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.auth-form {
    margin-bottom: 2rem;
}

.form-title {
    font-family: "Butcherman", cursive;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    line-height: 1.2;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.input-group label {
    display: block;
    font-family: "Butcherman", cursive;
    color: #b19cd9;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Error message styling - INLINE VALIDATION */
.error-message {
    color: #ff4444;
    font-size: 14px;
    margin-top: 6px;
    min-height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: "Butcherman", cursive;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message.show {
    min-height: 20px;
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
    animation: slideInShake 0.4s ease-out;
}

/* Input error state */
input.error {
    border: 2px solid #ff4444 !important;
    background-color: rgba(255, 68, 68, 0.15) !important;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3) !important;
}

/* Shake animation for error messages */
@keyframes slideInShake {
    0% { 
        opacity: 0;
        transform: translateY(-10px);
    }
    50% {
        opacity: 1;
        transform: translateY(0) translateX(-8px);
    }
    70% {
        transform: translateX(8px);
    }
    85% {
        transform: translateX(-4px);
    }
    100% {
        transform: translateX(0);
    }
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #6B1E6B;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    font-family: "Arial", sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #b19cd9;
    box-shadow: 0 0 15px rgba(107, 30, 107, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.input-group input::placeholder {
    color: #888;
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 3rem; /* Make room for the eye icon */
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 0.7;
}

.password-toggle:focus {
    outline: 2px solid #b19cd9;
    outline-offset: 2px;
    border-radius: 4px;
}

.eye-icon {
    font-size: 1.25rem;
    color: #b19cd9;
    user-select: none;
    line-height: 1;
}

/* When password is visible, change icon appearance */
.password-toggle.visible .eye-icon {
    opacity: 0.6;
}

/* Mobile responsiveness for password toggle */
@media (max-width: 768px) {
    .password-wrapper input {
        padding-right: 2.5rem;
    }
    
    .password-toggle {
        padding: 0.4rem 0.8rem;
    }
    
    .eye-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .password-wrapper input {
        padding-right: 2.25rem;
    }
    
    .password-toggle {
        padding: 0.35rem 0.7rem;
    }
    
    .eye-icon {
        font-size: 1rem;
    }
}

.auth-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6B1E6B 0%, #b19cd9 100%);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    font-size: 1.1rem;
    font-family: "Butcherman", cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 52px;
    -webkit-tap-highlight-color: rgba(107, 30, 107, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #b19cd9 0%, #6B1E6B 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 30, 107, 0.4);
}

.auth-btn:active {
    transform: scale(0.98) translateY(0);
    background: linear-gradient(135deg, #8B2E8B 0%, #9B7CB9 100%);
    box-shadow: 0 2px 8px rgba(107, 30, 107, 0.5);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #6B1E6B 0%, #b19cd9 100%);
}

.auth-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.auth-switch {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.switch-btn {
    background: none;
    border: none;
    color: #b19cd9;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-size: inherit;
    transition: color 0.3s ease;
}

.switch-btn:hover {
    color: #ffffff;
}

.auth-footer {
    border-top: 1px solid #444;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.footer-text {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.contact-text {
    color: #b19cd9;
    font-size: 0.9rem;
    margin: 0.8rem 0 0 0;
    font-family: "Butcherman", cursive;
}

.contact-email {
    color: #ff6b6b;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: bold;
}

.contact-email:hover {
    color: #ff8888;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

.notice-text {
    color: #ffffff;
    font-size: 0.85rem;
    margin: 0.6rem 0 0 0;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

/* Comprehensive responsive design for auth screen */

/* Large desktop (> 1024px) */
@media (min-width: 1025px) {
    .auth-content {
        padding: 3rem 2.5rem;
        max-width: 500px;
    }
    
    .auth-header {
        margin-bottom: 2.5rem;
    }
}

/* Tablet and medium screens (768px - 1024px) */
@media (max-width: 1024px) {
    .auth-screen {
        padding: 1.5rem 1rem;
    }
    
    .auth-content {
        padding: 2rem 1.5rem;
        width: min(90vw, 450px);
    }
    
    .auth-header {
        margin-bottom: 2rem;
    }
    
    .input-group {
        margin-bottom: 1.25rem;
    }
    
    .input-group label {
        font-size: 0.95rem;
    }
    
    .input-group input {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .auth-screen {
        padding: 1rem 0.5rem;
    }
    
    .auth-content {
        padding: 1.5rem 1.25rem;
        width: min(95vw, 400px);
        border-width: 2px;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .input-group input {
        padding: 0.85rem;
        font-size: 0.9rem;
    }
    
    .auth-btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .auth-switch {
        font-size: 0.85rem;
        margin-top: 1.25rem;
    }
    
    .footer-text,
    .contact-text {
        font-size: 0.85rem;
    }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
    .auth-screen {
        padding: 0.75rem 0.25rem;
    }
    
    .auth-content {
        padding: 1.25rem 1rem;
        width: min(98vw, 360px);
        max-height: 95vh;
    }
    
    .auth-header {
        margin-bottom: 1.25rem;
    }
    
    .auth-ghost {
        margin-top: 0.75rem;
    }
    
    .input-group {
        margin-bottom: 0.9rem;
    }
    
    .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .input-group input {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .auth-btn {
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
        min-height: 46px;
    }
    
    .auth-switch {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
    
    .auth-footer {
        padding-top: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .footer-text,
    .contact-text,
    .notice-text {
        font-size: 0.8rem;
    }
}

/* Low height screens (landscape mobile, short viewports) */
@media (max-height: 700px) {
    .auth-screen {
        padding: 1rem 0.5rem;
    }
    
    .auth-content {
        padding: 1.5rem 1.25rem;
        max-height: 92vh;
    }
    
    .auth-header {
        margin-bottom: 1rem;
    }
    
    .auth-ghost {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        margin-top: 0.5rem;
    }
    
    .form-title {
        margin-bottom: 1rem;
    }
    
    .input-group {
        margin-bottom: 0.75rem;
    }
    
    .auth-footer {
        padding-top: 1rem;
        margin-top: 1.25rem;
    }
}

/* Extra small height (landscape on very small phones) */
@media (max-height: 500px) {
    .auth-content {
        padding: 1rem;
        max-height: 95vh;
    }
    
    .auth-header {
        margin-bottom: 0.75rem;
    }
    
    .auth-ghost {
        display: none; /* Hide ghost on very short screens */
    }
    
    .form-title {
        margin-bottom: 0.75rem;
    }
    
    .input-group {
        margin-bottom: 0.6rem;
    }
    
    .input-group label {
        margin-bottom: 0.3rem;
    }
}

/* Logout Button */
.logout-button {
    background: rgba(139, 0, 0, 0.8);
    border: 2px solid #ff4444;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: rgba(139, 0, 0, 1);
    border-color: #ffffff;
    transform: scale(1.1);
}

.logout-icon {
    font-size: 1.3rem;
    color: #ffffff;
}

/* Ensure auth screen properly hides other content */
.auth-screen:not(.hidden) {
    display: flex !important;
    z-index: 50000 !important;
}

/* CRITICAL: Ensure auth screen is actually hidden when it has the hidden class */
.auth-screen.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Remove the problematic :has() selectors that prevent app from showing */
/* These were causing conflicts with the JavaScript screen management */

/* Email verification styles */
.verification-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1a1a 100%);
    border: 2px solid #8B0000;
    border-radius: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.verification-message.success {
    border-color: #2d5a2d;
    background: linear-gradient(135deg, #1a2a1a 0%, #1a2a1a 100%);
}

.verification-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.verification-message h2 {
    color: #8B0000;
    font-family: 'Creepster', cursive;
    margin-bottom: 20px;
    font-size: 2em;
}

.verification-message.success h2 {
    color: #4CAF50;
}

.verification-message p {
    color: #cccccc;
    margin-bottom: 15px;
    line-height: 1.6;
}

.verification-note {
    color: #FFD700 !important;
    font-weight: bold;
    padding: 15px;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 8px;
    margin: 20px 0 !important;
}

.verification-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.resend-btn, .back-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resend-btn {
    background: #8B0000;
    color: white;
}

.resend-btn:hover {
    background: #a00000;
    transform: translateY(-2px);
}

.back-btn {
    background: transparent;
    color: #8B0000;
    border: 2px solid #8B0000;
}

.back-btn:hover {
    background: #8B0000;
    color: white;
}

@media (min-width: 768px) {
    .verification-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Custom Notification Modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.notification-modal.hidden {
    display: none;
}

.notification-content {
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b3d 100%);
    border: 2px solid #8B0000;
    border-radius: 15px;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.notification-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.notification-icon.success {
    color: #28a745;
}

.notification-icon.error {
    color: #dc3545;
}

.notification-icon.info {
    color: #17a2b8;
}

.notification-message {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: left;
}

.notification-btn {
    background: linear-gradient(135deg, #8B0000 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.notification-btn:hover {
    background: linear-gradient(135deg, #cc0000 0%, #ff0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Account Management Section */
.account-management-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(204, 102, 153, 0.2);
}

.danger-zone {
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid rgba(139, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.danger-zone-title {
    color: #ff4444;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Butcherman', cursive;
}

.danger-zone-text {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.delete-account-button {
    background: linear-gradient(135deg, #8B0000 0%, #660000 100%);
    color: white;
    border: 2px solid #ff4444;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-account-button:hover {
    background: linear-gradient(135deg, #cc0000 0%, #8B0000 100%);
    border-color: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
}

.delete-icon {
    font-size: 1.2rem;
}

/* Delete Account Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a0a1a 0%, #2d1b3d 100%);
    border: 2px solid #cc6699;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(204, 102, 153, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: 'Butcherman', cursive;
    font-size: 1.5rem;
    color: #ff4444;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ff4444;
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

.warning-text {
    color: #ff6666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.confirmation-text {
    color: #e0e0e0;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.confirmation-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(204, 102, 153, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.confirmation-input:focus {
    outline: none;
    border-color: #cc6699;
    box-shadow: 0 0 10px rgba(204, 102, 153, 0.3);
}

.error-message {
    color: #ff4444;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 8px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ff4444;
}

.error-message.hidden {
    display: none;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(204, 102, 153, 0.3);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cancel-button {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(204, 102, 153, 0.3);
}

.cancel-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #cc6699;
}

.delete-button {
    background: linear-gradient(135deg, #8B0000 0%, #660000 100%);
    color: white;
    border-color: #ff4444;
}

.delete-button:hover {
    background: linear-gradient(135deg, #cc0000 0%, #8B0000 100%);
    border-color: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.6);
}

.delete-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.delete-button:disabled:hover {
    transform: none;
    box-shadow: none;
}
