/* vBionic Common Styles - Shared across all microservices */

:root {
    --primary-color: #57a8a8;
    --primary-dark: #3e8080;
    --primary-light: #6bc0c0;
    --secondary-color: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    gap: 1rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

.header h1 {
    color: var(--text-dark);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header h1 i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.header p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: var(--success-color);
}

.status-dot.offline {
    background: var(--danger-color);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Services Section */
.services-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1rem;
}

.section-title i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: block;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card.offline {
    opacity: 0.7;
    pointer-events: none;
}

.service-card.offline:hover {
    transform: none;
    box-shadow: var(--shadow);
}

/* Management cards styling */
.service-card.management {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid var(--border-color);
}

.service-card.management::before {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
}

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

.service-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px;
}

.service-icon i {
    font-size: 1.5rem;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
}

.status-indicator.inactive {
    background: var(--text-light);
}

.status-indicator.warning {
    background: var(--warning-color);
}

.status-indicator.error {
    background: var(--danger-color);
}

.status-indicator.active {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: var(--danger-color);
}

.service-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.service-description {
    color: var(--text-light);
    line-height: 1.5;
}

.service-features {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

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

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

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(87, 168, 168, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.stat-info small {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Recent Section */
.recent-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.recent-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.recent-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

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

.patient-info {
    flex: 1;
    min-width: 0;
}

.patient-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.patient-info p {
    margin: 0 0 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.patient-info small {
    color: var(--text-light);
    font-size: 0.75rem;
}

.patient-status {
    text-align: right;
    flex-shrink: 0;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.patient-status small {
    display: block;
    color: var(--text-light);
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--secondary-color);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--secondary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

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

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

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

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

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
/* Tablet landscape and small desktop (maintain 3 columns) */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
}

/* Tablet portrait (768px - 1024px) - Force 3 columns */
@media (min-width: 768px) and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    .service-title {
        font-size: 1.1rem;
    }
    
    .service-description {
        font-size: 0.85rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
    }
    
    .service-icon i {
        font-size: 1.25rem;
    }
}

/* Mobile landscape (still show 3 columns but smaller) */
@media (max-width: 767px) and (min-width: 576px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-title {
        font-size: 0.95rem;
    }
    
    .service-description {
        font-size: 0.75rem;
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
    }
    
    .service-icon i {
        font-size: 1rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
}

/* Mobile portrait (single column for very small screens) */
@media (max-width: 575px) {
    .container {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .status-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .patient-status {
        text-align: center;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .service-title {
        font-size: 1.1rem;
    }
}