/**
 * Nisbaty Public Styles
 *
 * @package    NisbatyApp
 * @subpackage Assets/CSS
 * @author     Mohammed Kassem <m.kassem@makcubes.com>
 * @company    MAKcubes
 */

/* ===== General Styles ===== */
.nisbaty-dashboard {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.nisbaty-project-single {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ===== Dashboard Header ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.user-details h2 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #333;
}

.user-company {
    margin: 0 0 5px;
    color: #666;
    font-size: 14px;
}

.user-role {
    margin: 0;
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #666;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-trend.positive { color: #10b981; }
.stat-trend.warning { color: #f59e0b; }

/* ===== Dashboard Layout ===== */
.dashboard-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-right {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== Dashboard Menu ===== */
.dashboard-menu {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dashboard-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-menu li {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    transition: all 0.2s;
}

.dashboard-menu li i {
    width: 20px;
    font-size: 16px;
}

.dashboard-menu li:hover {
    background: #f8f9fa;
    color: #333;
}

.dashboard-menu li.active {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
}

/* ===== Membership Card ===== */
.membership-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
}

.membership-card h3 {
    margin: 0 0 15px;
    font-size: 16px;
    opacity: 0.9;
}

.pack-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.pack-usage {
    margin-bottom: 15px;
}

.usage-item {
    margin-bottom: 10px;
}

.usage-item span {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    opacity: 0.9;
}

.usage-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
}

.usage-numbers {
    text-align: right;
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.9;
}

.pack-expiry {
    margin: 15px 0;
    font-size: 13px;
    opacity: 0.9;
}

.upgrade-btn {
    width: 100%;
    background: #fff;
    color: #667eea;
    border: none;
    margin-top: 10px;
}

/* ===== Achievements ===== */
.achievements-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.achievements-card h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.achievement-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 20px;
}

.achievement-content {
    flex: 1;
}

.achievement-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.achievement-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.achievement-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    font-size: 14px;
    color: #ddd;
}

.stars i.active {
    color: #fbbf24;
}

/* ===== Section Cards ===== */
.section-card {
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.view-all:hover {
    text-decoration: underline;
}

/* ===== Project/Offer Items ===== */
.project-item,
.offer-item,
.contract-item,
.legal-project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.project-item:last-child,
.offer-item:last-child,
.contract-item:last-child,
.legal-project-item:last-child {
    border-bottom: none;
}

.project-info h4,
.offer-info h4,
.contract-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.project-meta,
.offer-meta,
.contract-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

/* ===== Buttons ===== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.button-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: #fff;
}

.button-secondary {
    background: #fff;
    border: 1px solid #667eea;
    color: #667eea;
}

.button-secondary:hover {
    background: #f0f6fc;
}

.button-block {
    width: 100%;
}

.button.small {
    padding: 4px 12px;
    font-size: 13px;
}

.button i {
    font-size: 14px;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active { background: #d1fae5; color: #065f46; }
.status-under_review { background: #fef3c7; color: #92400e; }
.status-under_legal_review { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-draft { background: #f3f4f6; color: #374151; }
.status-signed { background: #d1fae5; color: #065f46; }

/* ===== Messages System ===== */
.nisbaty-messages-container {
    display: flex;
    height: 600px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.messages-sidebar {
    width: 30%;
    border-right: 1px solid #e9ecef;
    background: #f8f9fa;
    overflow-y: auto;
}

.messages-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages-header h3 {
    margin: 0;
    font-size: 16px;
}

.new-message-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messages-main {
    width: 70%;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.messages-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.messages-footer textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    height: 60px;
}

.send-message-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: #f1f3f5;
}

.conversation-item.active {
    background: #e0e7ff;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.conversation-header h4 {
    margin: 0;
    font-size: 14px;
}

.unread-badge {
    background: #f59e0b;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
}

.conversation-participants {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.conversation-last {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.conversation-time {
    font-size: 10px;
    color: #999;
    text-align: right;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message-mine {
    align-items: flex-end;
}

.message-other {
    align-items: flex-start;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #333;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.message-mine .message-content {
    background: #667eea;
    color: #fff;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
}

/* ===== Forms ===== */
.project-form {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.form-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.form-section h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.required label::after {
    content: ' *';
    color: #dc2626;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* ===== Location Picker ===== */
.location-picker-container {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.location-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #ddd;
}

.location-map {
    height: 300px;
    width: 100%;
}

/* ===== File Upload ===== */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.file-upload-area:hover,
.file-upload-area.highlight {
    border-color: #667eea;
    background: #f8f9fa;
}

.file-upload-area.loading {
    opacity: 0.6;
    pointer-events: none;
}

.file-upload-area i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.file-upload-area p {
    margin: 5px 0;
    color: #333;
}

.file-upload-area .small {
    font-size: 12px;
    color: #666;
}

.file-list {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item i {
    font-size: 20px;
    color: #667eea;
    margin-right: 10px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 12px;
    margin-right: 15px;
}

.remove-file {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.remove-file:hover {
    color: #dc2626;
}

/* ===== Login Prompt ===== */
.login-prompt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.prompt-content i {
    font-size: 48px;
    margin-bottom: 15px;
}

.prompt-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.prompt-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== Project Single ===== */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.project-title {
    font-size: 32px;
    color: #333;
    margin: 0 0 10px;
}

.project-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.info-card,
.stats-card,
.owner-card,
.offer-card,
.legal-card,
.parties-card,
.legal-offer-card,
.your-offer-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-card h3,
.stats-card h3,
.owner-card h3,
.offer-card h3,
.legal-card h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-description {
    line-height: 1.8;
    color: #333;
}

.project-description.preview {
    opacity: 0.7;
    position: relative;
}

.preview-note {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
    color: #666;
    font-style: italic;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.owner-details p,
.party-details p {
    margin: 8px 0;
    color: #333;
}

.owner-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ===== Notifications ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.notification-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.notification-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.notification-info {
    background: #e0e7ff;
    color: #3730a3;
    border-left: 4px solid #667eea;
}

/* ===== Loading States ===== */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner i {
    font-size: 24px;
    margin-right: 10px;
}

.form-group.loading {
    position: relative;
}

.form-group.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 1;
}

.form-group.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
    z-index: 2;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ===== No Data ===== */
.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-main {
        grid-template-columns: 1fr;
    }
    
    .project-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .button-block {
        width: 100%;
    }
    
    .project-item,
    .offer-item,
    .contract-item,
    .legal-project-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .project-meta,
    .offer-meta,
    .contract-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nisbaty-messages-container {
        flex-direction: column;
        height: auto;
    }
    
    .messages-sidebar,
    .messages-main {
        width: 100%;
    }
    
    .messages-sidebar {
        height: 300px;
    }
    
    .messages-main {
        height: 500px;
    }
}