/* css/4-modals.css */

.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    cursor: pointer;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    cursor: default;
}

/* Adjust modal width for Premium features Explore and Upgrade modal */
#upgradeModal .modal-content {
    max-width: 900px;
}

/* Base Modal "X" Close Button */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5em;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.modal-close-btn:hover {
    color: #333;
}

/* Base Modal Title */
.modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
}

/* Base Modal Footer Button Container */
.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* --- MODAL STACKING --- */
#authModal,
#eventDetailsModal,
#timelinesManagerModal,
#accountModal,
#friendsModal,
#messageModal,
#profileModal {
    z-index: 1000;
}

/* Modals that open on top of other modals */
#timelineModal,
#eventModal {
    z-index: 1010;
}

/* --- MODAL SCROLLING --- */
#authModal .modal-content,
#accountModal .modal-content,
#eventModal .modal-content,
#friendsModal .modal-content,
#timelinesManagerModal .modal-content,
#profileModal .modal-content,
#groupsModal .modal-content,
#groupCreateModal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* --- AUTH MODAL SPACING --- */
#authModal #signup-confirm-password-field {
    margin-bottom: 2px;
}

#authModal #login-buttons {
    margin-top: 4px;
}

#authModal #signup-buttons {
    margin-top: 8px;
}

#authModal > .modal-content > div:last-child {
    margin-top: 8px;
}

#authModal #forgot-password-section a:hover {
    text-decoration: underline;
}

/* --- ACCOUNT MODAL TABS --- */
.account-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
}

.account-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 1em;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.account-tab-btn:hover {
    color: #667eea;
}

.account-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* --- ACCOUNT SECTIONS --- */
.account-section {
    display: none;
}

.account-section.active {
    display: block;
}

/* --- MEMBERSHIP SECTION --- */
.membership-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.membership-plan-info,
.membership-storage-info {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.membership-plan-info h3,
.membership-storage-info h3 {
    font-size: 0.9em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}

.plan-name {
    font-size: 1.6em;
    font-weight: 700;
    color: #667eea;
    margin: 0 0 8px 0;
}

.plan-description {
    font-size: 0.9em;
    color: #999;
    margin: 0;
    font-style: italic;
}

.membership-features {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.membership-features h3 {
    font-size: 0.9em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 15px 0;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    color: #666;
}

.feature-checkmark {
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1em;
}

.storage-text {
    font-size: 0.95em;
    color: #666;
    margin: 0 0 12px 0;
}

.storage-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s;
}

.membership-footer {
    padding-top: 15px;
}

.membership-comparison {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.membership-comparison h3 {
    font-size: 0.9em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 20px 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.comparison-column {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.comparison-column:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.comparison-header {
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 12px;
}

.comparison-header h4 {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.comparison-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-list li {
    font-size: 0.85em;
    color: #666;
    padding-left: 18px;
    position: relative;
}

.comparison-list li:before {
    content: '✓';
    color: #4caf50;
    font-weight: bold;
    position: absolute;
    left: 0;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* --- UPGRADE MODAL STYLING --- */
.upgrade-modal-content {
    max-width: 650px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp 0.3s ease;
}

.upgrade-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.upgrade-modal-header h2 {
    color: #333;
    font-size: 1.5em;
    margin: 0 0 4px 0;
}

.upgrade-modal-subtitle {
    color: #999;
    font-size: 0.85em;
    margin: 0;
}

.upgrade-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* Align tiers side by side */
.upgrade-plans-grid.side-by-side {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.upgrade-plan-card {
    flex: 1;
    min-width: 250px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.upgrade-plan-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.upgrade-plan-card.featured {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.featured-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.plan-card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.plan-card-header h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #333;
    margin: 0 0 3px 0;
}

.plan-card-description {
    color: #999;
    font-size: 0.8em;
    margin: 0;
    font-style: italic;
}

.plan-card-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.85em;
}

.plan-feature-icon {
    font-size: 1.2em;
    min-width: 24px;
}

.plan-feature-check {
    font-size: 1em;
    color: #22c55e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
}

.plan-feature-x {
    font-size: 1em;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
}

.upgrade-modal-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.upgrade-modal-note {
    color: #999;
    font-size: 0.8em;
    margin-bottom: 10px;
}

/* --- UPGRADE NOTICE MODAL (for limit enforcement) --- */
.upgrade-notice-modal-content {
    max-width: 450px;
    animation: slideUp 0.3s ease;
}

.upgrade-notice-header {
    margin-bottom: 20px;
}

.upgrade-notice-header h3 {
    color: #d97706;
    font-size: 1.4em;
    margin: 0;
}

.upgrade-notice-body {
    margin-bottom: 25px;
}

.upgrade-notice-body > p {
    color: #666;
    font-size: 0.95em;
    margin: 0 0 15px 0;
}

.upgrade-notice-details {
    background: #fef3c7;
    border-left: 4px solid #d97706;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #78350f;
    line-height: 1.5;
}

.upgrade-notice-footer {
    display: flex;
    gap: 12px;
}

.upgrade-notice-footer button {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .upgrade-plans-grid {
        grid-template-columns: 1fr;
    }

    .upgrade-modal-header h2 {
        font-size: 1.4em;
    }
}

