/* Buddy Accountability System - Mobile-First White/Pink Minimalist Theme */

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

:root {
    --primary-pink: #FFB5C0;
    --light-pink: #FFD1D9;
    --pale-pink: #FFE8EB;
    --white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --dark-gray: #666666;
    --text-dark: #333333;
    --pink: #FFB5C0;
    --red: #f44336;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--off-white);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    color: var(--text-dark);
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: var(--primary-pink);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--light-pink);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-pink);
    color: var(--white);
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-primary:hover {
    background-color: var(--light-pink);
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
}

.btn-secondary:hover {
    background-color: var(--pale-pink);
}

.btn-block {
    display: block;
    width: 100%;
}

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

.btn-vouch:hover {
    background-color: #45a049;
}

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

.btn-incomplete:hover {
    background-color: #da190b;
}

/* Landing Page */
.landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--pale-pink) 0%, var(--white) 100%);
}

.landing-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.landing-title {
    font-size: 2.5rem;
    color: var(--primary-pink);
    margin-bottom: 0.5rem;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--pale-pink) 0%, var(--white) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px var(--shadow);
}

.auth-title {
    text-align: center;
    color: var(--primary-pink);
    margin-bottom: 1.5rem;
}

.auth-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-pink);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--dark-gray);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #ffebee;
    color: var(--red);
    border: 1px solid var(--red);
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--pink);
    border: 1px solid var(--pink);
}

/* App Container */
.app-container {
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--dark-gray);
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--primary-pink);
}

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

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 1rem;
    margin-top: 60px; /* Space for top nav */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-header h1 {
    margin-bottom: 0;
}

/* Pair Header Names */
.pair-header-names {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.pair-separator {
    font-size: 1.5rem;
    color: var(--primary-pink);
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--pale-pink);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-pink);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Cards */
.pair-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pair-card:hover {
    box-shadow: 0 4px 16px var(--shadow-hover);
    transform: translateY(-2px);
}

.pair-header {
    margin-bottom: 1rem;
}

.pair-users {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.pair-title {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.pair-info {
    display: flex;
    justify-content: space-between;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.pairs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Form Card */
.form-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 1.5rem;
}

/* Users List */
.users-list {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    margin-top: 1.5rem;
}

.users-list h3 {
    margin-bottom: 1rem;
}

.users-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-chip {
    background: var(--pale-pink);
    color: var(--primary-pink);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-chip:hover {
    background: var(--primary-pink);
    color: var(--white);
}

/* Goals Sections */
.goals-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.goals-section h2 {
    color: var(--primary-pink);
    margin-bottom: 1rem;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.goal-item {
    padding: 1rem;
    background: var(--pale-pink);
    border-radius: 10px;
    border-left: 4px solid var(--primary-pink);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.goal-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.goal-item p {
    margin: 0;
    color: var(--text-dark);
    flex: 1;
}

/* Custom Checkbox Styling */
.goal-checkbox-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}

.goal-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.goal-checkbox-custom {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--white);
    border: 2px solid var(--primary-pink);
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goal-checkbox-wrapper:hover .goal-checkbox-custom {
    border-color: var(--light-pink);
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.2);
    transform: scale(1.05);
}

.goal-checkbox:checked ~ .goal-checkbox-custom {
    background: var(--primary-pink);
    border-color: var(--primary-pink);
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.goal-checkbox-custom::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.goal-checkbox:checked ~ .goal-checkbox-custom::after {
    display: block;
}

.goal-tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--primary-pink);
    color: var(--white);
    white-space: nowrap;
    flex-shrink: 0;
}

.goal-item small {
    display: block;
    margin-top: 0.5rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

/* Today's Day Header */
.today-day-header {
    text-align: center;
    margin: 1.5rem 0;
}

.today-day-header h2 {
    color: var(--primary-pink);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Quote Section */
.quote-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid var(--primary-pink);
}

.quote-section h3 {
    color: var(--primary-pink);
    margin-bottom: 0.75rem;
}

.quote-text {
    font-style: italic;
    color: var(--text-dark);
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Self Promises Section */
.self-promises-section {
    margin: 1.5rem 0;
}

.self-promises-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.self-promise-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 8px var(--shadow);
}

.self-promise-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--pale-pink);
}

.self-promise-header h4 {
    margin: 0;
    color: var(--primary-pink);
    font-size: 1.125rem;
}

.self-promise-text {
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.self-promise-text em {
    color: var(--dark-gray);
    font-style: italic;
}

/* Vouch Section */
.vouch-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.vouch-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.vouch-form {
    flex: 1;
    min-width: 150px;
}

/* Days Section */
.days-section {
    margin-top: 1.5rem;
}

.days-section h2 {
    margin-bottom: 1rem;
}

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

.day-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s ease;
    display: block;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.day-card.completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid var(--pink);
}

.day-card.incomplete {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid var(--red);
}

.day-card-content {
    text-align: center;
}

.day-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.day-total {
    display: block;
    font-size: 0.875rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.day-status {
    margin-top: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.completed {
    background: var(--pink);
    color: var(--white);
}

.status-badge.incomplete {
    background: var(--red);
    color: var(--white);
}

/* Day Details */
.day-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.day-info-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

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

/* Notes Section */
.notes-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.notes-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notes-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid var(--gray);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-pink);
}

/* Locked Status Section */
.locked-status-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--pale-pink);
    border-radius: 10px;
}

.status-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-label {
    font-weight: 500;
    color: var(--text-dark);
}

.status-value {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

.status-value.locked {
    background: var(--pink);
    color: var(--white);
}

.status-value.unlocked {
    background: var(--red);
    color: var(--white);
}

.toggle-form {
    margin-top: 1rem;
}

.toggle-form small {
    display: block;
    margin-top: 0.5rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dark-gray);
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    .main-content {
        padding: 2rem;
    }
    
    .pairs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .days-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .vouch-controls {
        flex-direction: row;
    }
    
    .status-grid {
        flex-direction: row;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .main-content {
        padding: 2rem 3rem;
    }
    
    .pairs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .days-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .top-nav {
        padding: 1rem 0;
    }
    
    .nav-icon {
        font-size: 1.75rem;
    }
    
    .nav-label {
        font-size: 0.875rem;
    }
}

/* Tabs */
.tabs-container {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--dark-gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Accordion */
.goals-accordion {
    margin-bottom: 1rem;
    border: 1px solid var(--gray);
    border-radius: 10px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--pale-pink);
    cursor: pointer;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: var(--light-pink);
}

.accordion-header h3 {
    margin: 0;
    color: var(--primary-pink);
    font-size: 1.125rem;
}

.accordion-icon {
    color: var(--primary-pink);
    transition: transform 0.2s ease;
}

.accordion-content {
    padding: 1rem 1.5rem;
    background: var(--white);
    display: none;
}

.accordion-content.active {
    display: block;
}

.no-goals {
    color: var(--dark-gray);
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

.goal-date {
    display: block;
    margin-top: 0.5rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h2 {
    margin: 0;
    color: var(--primary-pink);
}

.modal-close {
    color: var(--dark-gray);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--primary-pink);
}

.modal-form {
    padding: 1.5rem;
}

.modal-form .form-group {
    margin-bottom: 1.25rem;
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.modal-form textarea,
.modal-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.modal-form textarea:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--primary-pink);
}

.modal-form textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    min-width: 100px;
}

/* Profile Page Styles */
.profile-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    margin-bottom: 1rem;
    color: var(--primary-pink);
    font-size: 1.5rem;
}

.profile-form {
    margin-top: 1rem;
}

.profile-pic-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.profile-pic-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-pink);
    box-shadow: 0 2px 8px var(--shadow);
}

.no-pic {
    color: var(--dark-gray);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid var(--primary-pink);
    box-shadow: 0 2px 8px var(--shadow);
}

.image-preview p {
    margin-top: 0.5rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

#char-count {
    color: var(--primary-pink);
    font-weight: 500;
}

/* Small Toggle Button */
.btn-toggle-small {
    background: var(--pale-pink);
    border: 1px solid var(--primary-pink);
    color: var(--primary-pink);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.btn-toggle-small:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: scale(1.05);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .goal-header {
        flex-wrap: wrap;
    }
    
    .goal-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .tab-btn {
        width: 100%;
        text-align: left;
    }
    
    .self-promises-grid {
        grid-template-columns: 1fr;
    }
}

/* Messaging System Styles */
.messages-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: calc(100vh - 140px);
    max-height: calc(100vh - 140px);
    gap: 0;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
}

/* Conversations Sidebar */
.conversations-sidebar {
    border-right: 1px solid var(--gray);
    display: flex;
    flex-direction: column;
    background: var(--off-white);
}

.conversations-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray);
    background: var(--white);
}

.conversations-header h2 {
    margin: 0;
    color: var(--primary-pink);
    font-size: 1.5rem;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray);
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s ease;
    cursor: pointer;
}

.conversation-item:hover {
    background: var(--pale-pink);
}

.conversation-item.active {
    background: var(--pale-pink);
    border-left: 4px solid var(--primary-pink);
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--pale-pink);
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--dark-gray);
}

.conversation-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-preview {
    font-size: 0.875rem;
    color: var(--dark-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    background: var(--primary-pink);
    color: var(--white);
    border-radius: 12px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    background: var(--white);
    overflow: hidden;
}

.no-conversation-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--dark-gray);
    text-align: center;
    padding: 2rem;
}

.no-conversation-selected h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
}

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

.chat-header-user span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary-pink);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.back-btn:hover {
    transform: translateX(-3px);
}

/* Messages List */
.messages-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--off-white);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.messages-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.message-bubble {
    display: flex;
    gap: 0.75rem;
    max-width: 70%;
    animation: slideIn 0.2s ease;
}

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

.message-sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-received {
    align-self: flex-start;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--pale-pink);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-pink);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-sent .message-content {
    background: var(--primary-pink);
    color: var(--white);
    border-radius: 15px 15px 4px 15px;
    padding: 0.75rem 1rem;
}

.message-received .message-content {
    background: var(--light-gray);
    color: var(--text-dark);
    border-radius: 15px 15px 15px 4px;
    padding: 0.75rem 1rem;
}

.message-text {
    margin: 0;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-sent .message-text {
    color: var(--white);
}

.message-image {
    margin-bottom: 0.5rem;
}

.message-image img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-image img:hover {
    transform: scale(1.02);
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-sent .message-time {
    color: var(--white);
}

.message-received .message-time {
    color: var(--dark-gray);
}

.delete-message-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-size: 0.8rem;
}

.delete-message-btn:hover {
    opacity: 1;
}

/* Message Input Area */
.message-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray);
    background: var(--white);
    flex-shrink: 0;
}

.message-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

#message-text {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s ease;
}

#message-text:focus {
    outline: none;
    border-color: var(--primary-pink);
}

.image-upload-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pale-pink);
    color: var(--primary-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.image-upload-btn:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: scale(1.05);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-pink);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--light-pink);
    transform: scale(1.05);
}

.image-preview-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--pale-pink);
    border-radius: 10px;
}

.image-preview-area img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
}

.remove-preview-btn {
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.image-modal-close:hover {
    color: var(--light-pink);
}

/* Mobile Responsive for Messages */
@media (max-width: 768px) {
    .messages-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
        position: relative;
        overflow: hidden;
    }
    
    /* Ensure chat container fits properly within messages container */
    .messages-container > .chat-container {
        height: 80%;
        max-height: 80%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }
    
    .conversations-sidebar.mobile-hidden {
        display: none;
    }
    
    .chat-container.mobile-hidden {
        display: none;
    }
    
    .chat-container {
        position: relative;
        height: 60%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    /* Ensure messages list doesn't push input area out of view */
    .chat-container > .messages-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Ensure input area is always visible and not cut off */
    .chat-container > .message-input-area {
        flex: 0 0 auto;
        position: relative;
        overflow: visible;
    }
    
    .back-btn.mobile-only {
        display: block;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .conversations-sidebar {
        border-right: none;
    }
    
    /* Keep message input area within chat container on mobile */
    .message-input-area {
        display: block !important;
        position: relative;
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
        border-top: 1px solid var(--gray);
        background: var(--white);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        width: 100%;
        box-sizing: border-box;
        flex: 0 0 auto;
        flex-shrink: 0;
        z-index: 10;
        order: 3;
        min-height: auto;
        overflow: visible;
        visibility: visible;
    }
    
    /* Adjust messages list to work with flexbox layout */
    .messages-list {
        flex: 1;
        min-height: 0;
        padding: 1.5rem;
        padding-bottom: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        order: 2;
    }
    
    /* Adjust chat header for mobile */
    .chat-header {
        order: 1;
        flex-shrink: 0;
        z-index: 100;
        position: relative;
    }
}

/* Mobile utility classes */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

