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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Color Variables */
:root {
    --primary: #2196F3;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --secondary: #9C27B0;
    --dark: #333333;
    --light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

/* Header */
.app-header {
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.header-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Main Content */
.app-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--white);
    font-size: 1.8rem;
}

/* Buttons */
.add-btn, .verify-btn, .plan-btn, .emergency-btn {
    background: var(--success);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover, .verify-btn:hover, .plan-btn:hover, .emergency-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

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

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card span {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark);
}

/* Quick Actions */
.quick-actions {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.quick-actions h2 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* Recent Activity */
.recent-activity {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.recent-activity h2 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-icon.success { background: var(--success); color: var(--white); }
.activity-icon.warning { background: var(--warning); color: var(--white); }
.activity-icon.danger { background: var(--danger); color: var(--white); }

.activity-details h4 {
    color: var(--dark);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.activity-details p {
    color: #666;
    font-size: 0.8rem;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.filter-tab {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

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

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    box-shadow: var(--shadow);
}

/* Assets List */
.assets-list {
    display: grid;
    gap: 1rem;
}

.asset-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.asset-card:hover {
    transform: translateY(-2px);
}

.asset-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.asset-info h3 {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.asset-info p {
    color: #666;
    font-size: 0.9rem;
}

.asset-type {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.asset-type.password { background: #e3f2fd; color: var(--primary); }
.asset-type.account { background: #e8f5e8; color: var(--success); }
.asset-type.file { background: #fff3e0; color: var(--warning); }

.asset-details {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.asset-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.asset-actions {
    display: flex;
    gap: 0.5rem;
}

.asset-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

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

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

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

/* Backup Status */
.backup-status-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.status-indicator {
    flex-shrink: 0;
}

.progress-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0deg, #eee 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--white);
    position: absolute;
}

.progress-circle span {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark);
}

.status-info h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.status-info p {
    color: #666;
    margin-bottom: 0.25rem;
}

.status-info small {
    color: #999;
    font-size: 0.8rem;
}

/* Backup Details */
.backup-details, .backup-recommendations {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.backup-details h3, .backup-recommendations h3 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.backup-report {
    max-height: 300px;
    overflow-y: auto;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

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

.report-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.report-status.success { background: var(--success); }
.report-status.warning { background: var(--warning); }
.report-status.error { background: var(--danger); }

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

.recommendation {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.recommendation i {
    color: var(--primary);
    margin-top: 0.25rem;
}

/* Inheritance Overview */
.inheritance-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.overview-card i {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.overview-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.overview-card span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark);
}

/* Inheritance Plans */
.inheritance-plans, .beneficiaries-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.inheritance-plans h3, .beneficiaries-section h3 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.inheritance-list, .beneficiaries-list {
    display: grid;
    gap: 1rem;
}

.plan-card, .beneficiary-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.3s ease;
}

.plan-card:hover, .beneficiary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.plan-header, .beneficiary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.plan-title, .beneficiary-name {
    font-weight: 600;
    color: var(--dark);
}

.plan-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-status.active { background: #e8f5e8; color: var(--success); }
.plan-status.draft { background: #fff3e0; color: var(--warning); }

.plan-details, .beneficiary-details {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.plan-actions, .beneficiary-actions {
    display: flex;
    gap: 0.5rem;
}

/* Emergency Status */
.emergency-status {
    margin-bottom: 2rem;
}

.status-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.status-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-card.emergency-active i {
    color: var(--success);
}

.status-card.emergency-inactive i {
    color: var(--danger);
}

.status-card h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.status-card p {
    color: #666;
}

/* Emergency Contacts */
.emergency-contacts {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.emergency-contacts h3 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.contacts-list {
    display: grid;
    gap: 1rem;
}

.contact-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.contact-info p {
    color: #666;
    font-size: 0.9rem;
}

.contact-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.contact-priority.high { background: #ffebee; color: var(--danger); }
.contact-priority.medium { background: #fff3e0; color: var(--warning); }
.contact-priority.low { background: #e8f5e8; color: var(--success); }

/* Emergency Instructions */
.emergency-instructions {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.emergency-instructions h3 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.instructions-card textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.instructions-card button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* FAQ Section */
.faq-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid #eee;
}

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

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-icon {
    font-size: 1.2rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: #666;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

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

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    z-index: 1;
}

.modal-content h2 {
    color: var(--dark);
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.modal-content form {
    padding: 1.5rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.assets-checklist {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
}

.asset-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.asset-checkbox:last-child {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-actions button[type="submit"] {
    background: var(--primary);
    color: var(--white);
}

.form-actions button[type="button"] {
    background: #f8f9fa;
    color: var(--dark);
}

.form-actions button:hover {
    transform: translateY(-2px);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.empty-state button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.empty-state button:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 0.5rem;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem;
    }
    
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .header-stats {
        font-size: 0.8rem;
    }
    
    .app-main {
        padding: 0.75rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .backup-status-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .inheritance-overview {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .filter-tabs {
        justify-content: flex-start;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .asset-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .asset-actions {
        justify-content: flex-start;
    }
    
    .contact-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .plan-header,
    .beneficiary-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
.p-1 { padding: 1rem; }
.hidden { display: none; }
.visible { display: block; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.message.success {
    background: #e8f5e8;
    color: var(--success);
    border: 1px solid var(--success);
}

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

.message.warning {
    background: #fff3e0;
    color: var(--warning);
    border: 1px solid var(--warning);
}
