/* CSS Variables - Matching Onboarding */
:root {
    --primary-color: #1d4163; /* Dark blue from logo */
    --primary-light: #e9f0f7;
    --secondary-color: #6c757d;
    --accent-color: #5cb3f5; /* Light blue from logo */
    --success-color: #28a745;
    --background: #f8f9fa;
    --border: #dee2e6;
    --text-color: #343a40;
    --text-muted: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #ecf0f1;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Header Styles */
header {
    background: var(--card-background);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.family-section {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.family-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.family-bio h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.family-bio p {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 500;
    color: var(--text-color);
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-phone {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-background);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-edit-link {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
    font-weight: 500;
    transition: var(--transition);
}

.stat-edit-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Content Cards */
.content-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--primary-color);
}

.settings-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.settings-link:hover {
    text-decoration: underline;
}

.card-content {
    padding: 20px;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-text {
    font-weight: 500;
    color: var(--text-color);
}

.setting-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 62px;
}

.setting-sub-item {
    padding: 8px 0 8px 62px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

/* Invite Friends Styles */
.invite-friends {
    background: var(--primary-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Invite Type Selector Styles */
.invite-type-selector {
    display: flex;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
    overflow: hidden;
}

.invite-type-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: white;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    min-height: 40px;
}

/* Desktop responsive styling */
@media (min-width: 768px) {
    .invite-type-selector {
        max-width: none; /* Remove width restriction to use full card width */
    }

    .invite-type-tab {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
        white-space: nowrap;
    }

    .invite-type-tab i {
        font-size: 15px;
    }

    .invite-type-tab span {
        margin-left: 2px;
    }
}

.invite-type-tab:not(:last-child) {
    border-right: 1px solid var(--border);
}

.invite-type-tab:hover {
    background: var(--primary-light);
    color: var(--text-color);
}

.invite-type-tab.active {
    background: var(--primary-color);
    color: white;
}

.invite-type-tab.active:hover {
    background: var(--primary-color);
}

.invite-type-tab i {
    font-size: 14px;
}

.invite-type-description {
    text-align: center;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    min-height: 18px;
}

/* Desktop styling for description */
@media (min-width: 768px) {
    .invite-type-description {
        font-size: 13px;
        margin-bottom: 16px;
        line-height: 1.4;
    }
}

.invite-phone-input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
}

.invite-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.invite-btn:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.invite-btn:hover:not(:disabled) {
    background-color: #15344f;
}

.invite-phone-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 65, 99, 0.2);
}

.invite-message-group {
    position: relative;
    margin-bottom: 10px;
}

.invite-message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.invite-message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 65, 99, 0.2);
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
}

.invite-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
}

.invite-btn:hover:not(:disabled) {
    background: var(--accent-color);
}

.invite-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

#inviteValidationMsg, #inviteStatusMsg {
    font-size: 14px;
    margin-top: 5px;
}

.validation-success {
    color: var(--success-color);
    font-weight: 500;
}

.validation-error {
    color: var(--accent-color);
    font-weight: 500;
}

/* Ensure desktop follows the same vertical layout as mobile */
@media (min-width: 769px) {
    .invite-friends {
        display: block;
    }
}

/* Mobile responsiveness for invite section */
@media (max-width: 768px) {
    .invite-phone-input {
        width: 100%;
    }

    .invite-btn {
        width: 100%;
    }

    .invite-message-input {
        min-height: 80px;
    }
}

/* Add Connection Styles */
.add-connection {
    background: var(--primary-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.connection-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.connection-url-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.connection-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 65, 99, 0.2);
}

.connect-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.connect-btn:hover:not(:disabled) {
    background: var(--accent-color);
}

.connect-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

#validationMsg, #statusMsg {
    font-size: 14px;
    margin-top: 5px;
}

/* Calendar List */
.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--background-color);
}

.calendar-info h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.calendar-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.friends {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.status-badge.lookahead {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--secondary-color);
}

/* Location Info */
.location-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.location-item:last-child {
    border-bottom: none;
}

.location-item label {
    font-weight: 500;
    color: var(--text-color);
}

.location-item span {
    color: var(--text-muted);
}

.personalize-text {
    color: var(--primary-color) !important;
    font-style: italic;
    font-weight: 500;
}

.location-note {
    background-color: rgba(52, 152, 219, 0.1);
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Share Section */
.share-section p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.share-link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-link-container input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--background-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Video Container */
.video-container {
    text-align: center;
    padding: 20px;
}

.video-container h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.video-container p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.youtube-embed {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.youtube-embed iframe {
    display: block;
    max-width: 100%;
    height: auto;
    min-height: 200px;
}

.video-actions {
    margin-top: 20px;
}

.video-actions .btn-secondary {
    background-color: #ff0000;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.video-actions .btn-secondary:hover {
    background-color: #cc0000;
    transform: translateY(-1px);
}

/* Settings Section */
.settings-section {
    text-align: center;
    padding: 30px 0;
}

.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-settings:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.btn-primary:hover {
    background-color: #15344f;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--text-muted);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

/* Sign In Page - Matching Onboarding Style */
.signin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
    padding: 0;
}

.signin-content {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.logo-section {
    padding: 30px 40px;
    background-color: white;
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    height: 270px;
    width: auto;
    margin-bottom: 25px;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.logo-section p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.signin-section {
    padding: 30px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#google-sign-in {
    margin: 0 auto;
    display: flex;
    width: 100%;
    max-width: 300px;
}

#google-sign-in img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.signin-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-overlay p {
    color: white;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .family-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .family-image {
        width: 100px;
        height: 100px;
    }

    .stats-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .input-group {
        flex-direction: column;
    }

    .share-link-container {
        flex-direction: column;
    }

    .location-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .signin-content {
        max-width: 95%;
        margin: 20px 0;
    }

    .logo-section, .signin-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 0 15px;
    }

    .card-content {
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card i {
        font-size: 1.5rem;
    }

    .stat-content h3 {
        font-size: 1.2rem;
    }
}

/* Assistant Section */
.assistant-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assistant-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 8px;
}

.assistant-examples {
    background: var(--primary-light);
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.assistant-examples p {
    margin: 0 0 12px 0;
    font-weight: 500;
    color: var(--text-color);
}

.assistant-examples ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.assistant-examples li {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.assistant-examples li:last-child {
    margin-bottom: 0;
}

/* Connections Section */
.connections-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.connection-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.count-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.count-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
}

.connections-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Mobile adjustments for new sections */
@media (max-width: 768px) {
    .connection-count {
        justify-content: center;
    }

    .assistant-examples ul {
        padding-left: 0;
    }

    .youtube-embed iframe {
        min-height: 180px;
    }

    .video-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .youtube-embed iframe {
        min-height: 160px;
    }
}

/* Alpha Badge */
.alpha-badge {
    background: linear-gradient(135deg, var(--accent-color) 0%, #4a9eff 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 16px;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(92, 179, 245, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: help;
}

.alpha-badge::before {
    content: "★";
    margin-right: 4px;
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Feedback Section */
.feedback-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.feedback-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.feedback-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.feedback-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
