/* ==========================================================================
   ClientHub Pro Frontend Styles
   ========================================================================== */

/* Global Styles */
.clienthub-pro {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.clienthub-pro * {
    box-sizing: border-box;
}

/* Container */
.clienthub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.clienthub-header {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    padding: 20px 0;
    margin-bottom: 30px;
}

.clienthub-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clienthub-logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.clienthub-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.clienthub-user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 600;
}

/* Navigation */
.clienthub-nav {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 30px;
}

.clienthub-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.clienthub-nav a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.clienthub-nav a:hover,
.clienthub-nav a.active {
    background: #fff;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Cards */
.clienthub-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.clienthub-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.clienthub-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.clienthub-card p {
    margin: 0 0 12px 0;
    color: #6c757d;
}

/* Project Cards */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card .project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.project-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status.active {
    background: #d4edda;
    color: #155724;
}

.project-status.completed {
    background: #cce5ff;
    color: #0056b3;
}

.project-status.on-hold {
    background: #fff3cd;
    color: #856404;
}

.project-progress {
    margin: 16px 0;
}

.project-progress .progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6c757d;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #6c757d;
}

/* Task List */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.task-checkbox.completed {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
}

.task-title.completed {
    text-decoration: line-through;
    color: #6c757d;
}

.task-meta {
    font-size: 12px;
    color: #6c757d;
}

.task-priority {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
}

.task-priority.high {
    background: #dc3545;
}

.task-priority.medium {
    background: #ffc107;
}

.task-priority.low {
    background: #28a745;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #fff;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Forms */
.clienthub-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.form-text.error {
    color: #dc3545;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-icon {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.uploaded-files {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-icon {
    width: 32px;
    height: 32px;
    background: #667eea;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 12px;
    font-size: 14px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: #6c757d;
}

/* Messages */
.message-thread {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.message {
    display: flex;
    margin-bottom: 16px;
}

.message:last-child {
    margin-bottom: 0;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 600;
    font-size: 12px;
    margin-right: 12px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: 500;
    color: #495057;
    margin-right: 8px;
}

.message-time {
    font-size: 12px;
    color: #6c757d;
}

.message-text {
    color: #495057;
    line-height: 1.5;
}

/* Notifications */
.notification {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.notification-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Modal */
.clienthub-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.clienthub-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Tables */
.clienthub-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.clienthub-table th {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e1e5e9;
}

.clienthub-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.clienthub-table tr:last-child td {
    border-bottom: none;
}

.clienthub-table tr:hover {
    background: #f8f9fa;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .clienthub-container {
        padding: 0 15px;
    }
    
    .clienthub-header .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .clienthub-nav ul {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .clienthub-card {
        padding: 20px;
    }
    
    .project-card .project-header {
        flex-direction: column;
        align-items: start;
        gap: 12px;
    }
    
    .project-meta {
        flex-direction: column;
        align-items: start;
        gap: 8px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    .clienthub-table {
        font-size: 14px;
    }
    
    .clienthub-table th,
    .clienthub-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .clienthub-header {
        padding: 15px 0;
    }
    
    .clienthub-logo {
        font-size: 20px;
    }
    
    .clienthub-logo .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .clienthub-card {
        padding: 16px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .clienthub-pro {
        color: #e9ecef;
    }
    
    .clienthub-header {
        background: #2c3e50;
        border-bottom-color: #495057;
    }
    
    .clienthub-card {
        background: #343a40;
        border-color: #495057;
    }
    
    .form-control {
        background: #495057;
        border-color: #6c757d;
        color: #e9ecef;
    }
    
    .clienthub-table {
        background: #343a40;
    }
    
    .clienthub-table th {
        background: #495057;
        color: #e9ecef;
    }
    
    .clienthub-table td {
        color: #e9ecef;
        border-bottom-color: #495057;
    }
}

/* Print styles */
@media print {
    .clienthub-header,
    .clienthub-nav,
    .btn,
    .modal-close {
        display: none;
    }
    
    .clienthub-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .clienthub-pro {
        font-size: 12px;
    }
}