/* PrivPortal Frontend Styles */

.privportal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.privportal-container h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Error messages */
.privportal-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 25px;
    color: #c53030;
    box-shadow: 0 2px 4px rgba(197, 48, 48, 0.1);
}

.privportal-error p {
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.privportal-error strong {
    color: #9b2c2c;
    margin-right: 8px;
}

/* Search Section */
.privportal-search {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-group {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.privportal-search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.privportal-search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    background: #5a6268;
    transform: translateY(-50%) scale(1.1);
}

/* Filters Section */
.privportal-filters {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    float: none;
    margin-right: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-select {
    width: 250px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    min-height: 44px;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-actions {
    float: none;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.filter-btn.secondary {
    background: #6c757d;
}

.filter-btn.secondary:hover {
    background: #5a6268;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

/* Summary */
.privportal-summary {
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
}

.privportal-summary p {
    margin: 0;
    color: #2c5282;
    font-weight: 500;
}

.privportal-summary strong {
    color: #1a365d;
}

/* Documents Grid */
.privportal-documents-grid {
    margin-top: 20px;
}

.privportal-documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.privportal-hidden {
    display: none !important;
}

.privportal-job-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}

.privportal-job-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.job-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 18px 25px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.job-icon {
    font-size: 20px;
}

.job-count {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: auto;
}

.documents-list {
    padding: 20px;
}

.privportal-document-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid #f0f3f5;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fafbfc;
    transition: all 0.2s ease;
}

.privportal-document-card:last-child {
    margin-bottom: 0;
}

.privportal-document-card:hover {
    background: #f1f5f9;
    border-color: #d1d9e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.document-icon {
    font-size: 32px;
    margin-right: 18px;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

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

.document-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 16px;
    word-break: break-word;
    line-height: 1.3;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #718096;
    align-items: center;
}

.document-size {
    background: #edf2f7;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.document-date {
    display: flex;
    align-items: center;
}

.document-date::before {
    content: "🕒";
    margin-right: 5px;
}

.document-user {
    background: #fef5e7;
    color: #b7950b;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.document-tag {
    background: #e8f5e8;
    color: #2d7d2d;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.document-description {
    background: #f0f8ff;
    color: #1e5ba8;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.document-actions {
    margin-left: 20px;
    flex-shrink: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00c851 0%, #00a846 100%);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 200, 81, 0.2);
}

.download-btn:hover {
    background: linear-gradient(135deg, #00a846 0%, #008f3d 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 200, 81, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* Empty State */
.privportal-empty {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    margin: 40px 0;
}

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

.privportal-empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
}

.privportal-empty-text {
    font-size: 16px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .privportal-container {
        padding: 15px;
    }
    
    .privportal-filters {
        padding: 15px;
    }
    
    .filter-group,
    .filter-actions {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .privportal-document-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .document-info {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .document-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .job-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px 20px;
    }
    
    .job-count {
        margin-left: 0;
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .privportal-container h2 {
        font-size: 24px;
    }
    
    .document-name {
        font-size: 15px;
    }
    
    .privportal-empty {
        padding: 60px 15px;
    }
    
    .privportal-empty-icon {
        font-size: 48px;
    }
}

/* Loading state */
.privportal-loading {
    text-align: center;
    padding: 60px;
    color: #718096;
}

.privportal-loading::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

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