/* DCG Family Connect Portal Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

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

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 5px;
}

.logo h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features */
.features {
    margin-bottom: 60px;
}

.features h3 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

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

.feature-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h4 {
    font-size: 20px;
    margin-bottom: 10px;
}

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

/* Pricing */
.pricing {
    margin-bottom: 60px;
}

.pricing h3 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

.pricing-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.price {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.price span {
    font-size: 24px;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
}

.pricing-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 15px;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Auth Pages */
.auth-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
}

.auth-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

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

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: #d1fae5;
    color: var(--success-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

.pricing-summary {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
}

.pricing-summary h4 {
    margin-bottom: 15px;
}

.pricing-summary ul {
    list-style: none;
    margin-bottom: 15px;
}

.pricing-summary li {
    padding: 5px 0;
    color: var(--text-secondary);
}

.price-note {
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    height: 100vh;
    background: var(--bg-light);
}

.sidebar {
    width: 280px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar .logo h2 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 30px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-menu li.active a {
    background: var(--primary-color);
    color: white;
}

.nav-menu .icon {
    margin-right: 12px;
    font-size: 20px;
}

.user-info {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.dashboard-header h1 {
    font-size: 24px;
}

.dashboard-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.connections-panel {
    width: 350px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.connections-list {
    flex: 1;
    overflow-y: auto;
}

.messages-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Message Thread */
.message-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.thread-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
}

.thread-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.thread-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}

.message {
    margin-bottom: 20px;
    max-width: 70%;
}

.message.outbound {
    margin-left: auto;
}

.message.inbound {
    margin-right: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.outbound .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.inbound .message-content {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    padding: 0 4px;
}

.voice-note {
    min-width: 220px;
}

.voice-note-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.voice-note audio {
    width: 100%;
    max-width: 320px;
    display: block;
}

.message-input-container {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 20px 30px;
}

.message-input-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    margin-bottom: 10px;
}

.message-input-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.char-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    cursor: pointer;
    min-height: 40px;
}

.voice-record-btn.recording {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.voice-recorder-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
}

.voice-recorder-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.voice-recorder-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-recorder-controls audio {
    flex: 1;
    min-width: 220px;
}

/* Connection Items */
.connection-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.connection-item:hover {
    background: var(--bg-light);
}

.connection-item.active {
    background: var(--bg-light);
    border-left: 3px solid var(--primary-color);
}

.connection-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
}

.connection-info {
    flex: 1;
}

.connection-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.connection-facility {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.connection-last-message {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* How It Works */
.how-it-works {
    margin-bottom: 60px;
}

.how-it-works h3 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

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

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step h4 {
    font-size: 20px;
    margin-bottom: 10px;
}

.step p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .dashboard-body {
        flex-direction: column;
    }

    .connections-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 300px;
    }

    .message {
        max-width: 85%;
    }
}
