/* 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, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Color Palette Variables */
:root {
    --primary-blue: #2196F3;
    --success-green: #4CAF50;
    --warning-yellow: #FFC107;
    --danger-red: #F44336;
    --accent-purple: #9C27B0;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

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

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

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

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

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

.stat-card {
    background: var(--white);
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

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

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.25rem;
}

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

/* Network Preview */
.network-preview {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.network-preview h2 {
    margin-bottom: 1rem;
    color: var(--dark-gray);
    font-size: 1.3rem;
}

#network-canvas {
    width: 100%;
    height: 250px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

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

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

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

.activity-item {
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.activity-item .activity-text {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-item .activity-time {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

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

.section-header h2 {
    color: var(--dark-gray);
    font-size: 1.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

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

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

.btn-secondary {
    background: var(--medium-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Search and Filter */
.search-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-filter input,
.search-filter select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Contacts List */
.contacts-list {
    display: grid;
    gap: 1rem;
}

.contact-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

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

.contact-info h3 {
    color: var(--dark-gray);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.contact-info .position {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.contact-info .company {
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 0.9rem;
}

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

.contact-actions button {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-actions button:hover {
    background: var(--light-gray);
}

.contact-actions .edit-btn {
    color: var(--primary-blue);
}

.contact-actions .delete-btn {
    color: var(--danger-red);
}

.contact-details {
    display: grid;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--medium-gray);
}

.area-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success-green);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Opportunities List */
.opportunities-list {
    display: grid;
    gap: 1rem;
}

.opportunity-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--warning-yellow);
}

.opportunity-card h3 {
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.opportunity-card p {
    color: var(--medium-gray);
    margin-bottom: 0.75rem;
}

.opportunity-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.opportunity-contact {
    background: var(--light-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--dark-gray);
}

/* Reminders List */
.reminders-list {
    display: grid;
    gap: 1rem;
}

.reminder-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-purple);
}

.reminder-card.overdue {
    border-left-color: var(--danger-red);
}

.reminder-card.today {
    border-left-color: var(--warning-yellow);
}

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

.reminder-info h3 {
    color: var(--dark-gray);
    margin-bottom: 0.25rem;
}

.reminder-info .reminder-type {
    color: var(--medium-gray);
    font-size: 0.9rem;
    text-transform: capitalize;
}

.reminder-date {
    background: var(--light-gray);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--dark-gray);
    text-align: center;
    min-width: 80px;
}

.reminder-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reminder-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.complete-btn {
    background: var(--success-green);
    color: var(--white);
}

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

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

.delete-reminder-btn:hover {
    background: #da190b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

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

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

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

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

.modal-header h3 {
    color: var(--dark-gray);
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--medium-gray);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--light-gray);
    color: var(--dark-gray);
}

/* Form Styles */
form {
    padding: 1.5rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

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

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

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

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

.form-actions button[type="submit"]:hover {
    background: #1976D2;
}

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

.form-actions button[type="button"]:hover {
    background: #e9ecef;
}

/* FAQ Styles */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.faq-question:hover {
    background: var(--light-gray);
}

.faq-question[aria-expanded="true"] {
    background: var(--light-gray);
}

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

.faq-icon {
    font-size: 1.2rem;
    font-weight: 300;
    transition: var(--transition);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--medium-gray);
    line-height: 1.6;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--medium-gray);
    font-style: italic;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

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

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--medium-gray);
    transition: var(--transition);
    border-radius: 8px;
    min-width: 60px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-blue);
    background: rgba(33, 150, 243, 0.1);
}

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

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--medium-gray);
    font-size: 0.9rem;
    background: var(--white);
    margin-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (min-width: 768px) {
    .app-main {
        padding: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dashboard {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
    
    .dashboard > .stats-grid {
        grid-column: 1 / -1;
    }
    
    .search-filter {
        flex-direction: row;
    }
    
    .contacts-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .opportunities-list,
    .reminders-list {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .bottom-nav {
        position: relative;
        border-top: none;
        border-bottom: 1px solid #e0e0e0;
        order: -1;
        box-shadow: var(--shadow);
        margin-bottom: 2rem;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .nav-item {
        min-width: 100px;
    }
}

@media (min-width: 1024px) {
    .app-main {
        padding: 2rem 3rem;
    }
    
    .modal-content {
        max-width: 600px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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