/* napster - Nap Dating App Styles */

:root {
    --primary-color: #6B5B95;
    --secondary-color: #88B04B;
    --accent-color: #F7CAC9;
    --dark-bg: #2C2C2C;
    --light-bg: #F5F5F5;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    
    /* Safe area insets for iPhone notch/island */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Improve touch responsiveness on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    /* Enable smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

#app {
    min-height: 100vh;
    /* Account for safe areas on iPhone */
    min-height: calc(100vh - var(--safe-area-top) - var(--safe-area-bottom));
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    /* Add safe area padding for iPhone notch */
    padding-top: var(--safe-area-top);
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    width: auto;
    height: 40px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
    /* Ensure minimum touch target size for mobile */
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
}

.nav-btn:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-btn .icon {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* Swipe View */
.swipe-container {
    max-width: 500px;
    margin: 0 auto;
}

.card-stack {
    position: relative;
    height: 600px;
}

.profile-card {
    position: absolute;
    width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 1.5rem;
}

.card-info h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.age {
    font-weight: normal;
    color: var(--text-secondary);
}

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

.sleep-cred {
    margin-bottom: 1rem;
}

.cred-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.nap-preferences {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--light-bg);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--light-bg);
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    /* Better touch feedback */
    user-select: none;
    -webkit-user-select: none;
}

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

.action-btn.reject {
    background-color: #FF6B6B;
    color: white;
}

.action-btn.info {
    background-color: var(--card-bg);
    color: var(--primary-color);
}

.action-btn.accept {
    background-color: var(--secondary-color);
    color: white;
}

.action-btn:hover {
    transform: scale(1.1);
}

.swipe-hint {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Map View */
.map-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

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

.map-canvas {
    width: 100%;
    height: 400px;
    background: var(--light-bg);
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
}

.map-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.map-placeholder .small {
    font-size: 0.9rem;
}

.nap-spots-list h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.spot-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: center;
}

.spot-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.spot-info {
    flex: 1;
}

.spot-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.spot-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Social Feed */
.social-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.post-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.post-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-image {
    width: 100%;
    border-radius: 12px;
    margin-top: 1rem;
}

.post-stats {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.post-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.post-btn:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* Challenges */
.challenges-container {
    max-width: 900px;
    margin: 0 auto;
}

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

.cred-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.cred-icon {
    font-size: 1.5rem;
}

.cred-amount {
    font-size: 1.5rem;
    font-weight: bold;
}

.cred-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.challenges-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.challenge-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

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

.challenge-header h3 {
    color: var(--primary-color);
}

.challenge-reward {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.challenge-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.challenge-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--light-bg);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    transition: width 0.3s ease;
}

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

.challenge-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.challenge-actions {
    display: flex;
    gap: 1rem;
}

.nap-dates-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.nap-dates-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.nap-date-item {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.nap-date-item img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
}

.nap-date-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nap-date-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* Profile */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
}

.profile-header {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.profile-main {
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: start;
    position: relative;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    margin-top: -75px;
    object-fit: cover;
}

.profile-details {
    flex: 1;
}

.profile-details h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.profile-tagline {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.profile-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.profile-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.preferences-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pref-tag {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 12px;
    align-items: center;
}

.activity-icon {
    font-size: 1.5rem;
}

.activity-text {
    flex: 1;
}

.activity-text p {
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-cred {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-small {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #5a4a7d;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background-color: var(--light-bg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.input-field, .post-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

.post-input {
    min-height: 120px;
    resize: vertical;
}

.post-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: space-around;
        gap: 0.5rem;
    }

    .nav-btn span:not(.icon) {
        display: none;
    }
    
    .nav-btn {
        flex: 1;
        max-width: 60px;
    }

    .main-content {
        padding: 1rem;
        /* Add safe area padding for home indicator on iPhone */
        padding-bottom: calc(1rem + var(--safe-area-bottom));
    }
    
    /* Larger touch targets for mobile */
    .action-btn {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .card-actions {
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    /* Better mobile spacing for swipe cards */
    .swipe-container {
        padding: 0;
    }
    
    .card-stack {
        height: calc(100vh - 250px);
        max-height: 650px;
    }

    .profile-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .challenges-header {
        flex-direction: column;
        gap: 1rem;
    }

    .challenge-actions {
        flex-direction: column;
    }
    
    /* Better button sizing on mobile */
    .btn-primary, .btn-secondary {
        min-height: 48px;
        font-size: 1.05rem;
        width: 100%;
    }
    
    .post-btn {
        min-height: 44px;
    }
    
    /* Improve modal on mobile */
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    /* Better input sizing on mobile */
    .input-field, .post-input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
}
