/* Family Tree Application Styles - Warm & Nostalgic Theme */

:root {
    --primary-color: #8B4513;
    --secondary-color: #D4A574;
    --accent-color: #C19A6B;
    --bg-light: #FAF7F2;
    --bg-cream: #F5EFE6;
    --text-dark: #3E2723;
    --text-medium: #5D4037;
    --text-light: #8D6E63;
    --success: #6B8E23;
    --error: #B22222;
    --shadow: rgba(139, 69, 19, 0.1);
    --shadow-dark: rgba(139, 69, 19, 0.2);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    color: var(--primary-color);
}

/* Landing Page */
.landing {
    min-height: 100vh;
}

.hero {
    min-height: 90vh;
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light) 100%);
    display: flex;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-medium);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.tree-illustration svg {
    width: 100%;
    max-width: 400px;
    filter: drop-shadow(0 4px 20px var(--shadow));
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background-color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-cream);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--secondary-color);
}

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

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Lato', sans-serif;
}

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

.btn-primary:hover {
    background-color: #6F3710;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

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

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

.btn-full {
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(62, 39, 35, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 3rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px var(--shadow-dark);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-large {
    max-width: 700px;
}

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

.close {
    color: var(--text-light);
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--bg-cream);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.3s;
}

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

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background-color: white;
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand h1 {
    font-size: 1.8rem;
    margin: 0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user span {
    color: var(--text-medium);
    font-weight: 600;
}

.dashboard-container {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 300px;
    background-color: white;
    padding: 2rem;
    box-shadow: 2px 0 10px var(--shadow);
}

.sidebar-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.trees-list {
    margin-top: 1.5rem;
}

.tree-item {
    background-color: var(--bg-cream);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tree-item:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.tree-item.active {
    background-color: var(--primary-color);
    color: white;
}

.tree-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: inherit;
}

.tree-item p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.welcome-screen {
    text-align: center;
    max-width: 600px;
    margin: 5rem auto;
}

.welcome-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-screen p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Tree View */
.tree-view {
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-cream);
}

.tree-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tree-header p {
    color: var(--text-light);
}

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

.tree-canvas {
    min-height: 500px;
    background: linear-gradient(135deg, var(--bg-light) 0%, white 100%);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: auto;
}

/* Family Member Cards in Tree */
.member-card {
    background-color: white;
    border: 3px solid var(--secondary-color);
    border-radius: 12px;
    padding: 1rem;
    width: 180px;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
}

.member-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px var(--shadow-dark);
}

.member-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

.member-card .name {
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.member-card .dates {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow-dark);
    transform: translateY(200px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    min-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 2rem;
        margin: 10% auto;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-cream);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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