/**
 * MZTS Dashboard Frontend Styles
 * 
 * @package MZTS_Dashboard
 */

/* Dashboard Wrapper */
.mzts-dash-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.mzts-dash-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2196f3;
}

.mzts-dash-header h1 {
    margin: 0 0 10px;
    font-size: 32px;
    color: #333;
}

.mzts-dash-welcome {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Tabs */
.mzts-dash-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.mzts-dash-tab {
    padding: 12px 24px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.mzts-dash-tab:hover {
    background: #e0e0e0;
}

.mzts-dash-tab.active {
    background: #2196f3;
    color: #fff;
}

/* Content */
.mzts-dash-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Alerts */
.mzts-dash-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
}

.mzts-dash-alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.mzts-dash-alert-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #0d47a1;
}

.mzts-dash-alert-success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #1b5e20;
}

/* Contract Cards */
.mzts-dash-contract-card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.mzts-dash-contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.mzts-dash-contract-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.mzts-dash-contract-info p {
    margin: 8px 0;
    font-size: 15px;
    color: #555;
}

.mzts-dash-contract-content {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
    max-height: 200px;
    overflow-y: auto;
}

.mzts-dash-contract-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Signature Form */
.mzts-dash-signature-form {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.mzts-dash-form-group {
    margin-bottom: 15px;
}

.mzts-dash-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.mzts-dash-form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Buttons */
.mzts-dash-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.mzts-dash-btn-primary {
    background: #2196f3;
    color: #fff;
}

.mzts-dash-btn-primary:hover {
    background: #1976d2;
}

.mzts-dash-btn-secondary {
    background: #757575;
    color: #fff;
}

.mzts-dash-btn-secondary:hover {
    background: #616161;
}

.mzts-dash-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Status Badges */
.mzts-dash-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.mzts-dash-status-pending {
    background: #ff9800;
}

.mzts-dash-status-sent {
    background: #2196f3;
}

.mzts-dash-status-canceled {
    background: #f44336;
}

.mzts-dash-status-canceled {
    background: #f44336;
}

.mzts-dash-status-received {
    background: #4caf50;
}

.mzts-dash-status-signed {
    background: #4caf50;
}

.mzts-dash-status-canceled {
    background: #f44336;
}

.mzts-dash-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mzts-dash-badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Filter Form */
.mzts-dash-filter-form {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.mzts-dash-filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.mzts-dash-filter-group {
    flex: 1;
    min-width: 150px;
}

.mzts-dash-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

.mzts-dash-filter-group select,
.mzts-dash-filter-group input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Stats */
.mzts-dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.mzts-dash-stat-box {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    text-align: center;
}

.mzts-dash-stat-label {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.mzts-dash-stat-value {
    font-size: 32px;
    font-weight: bold;
}

/* Table */
.mzts-dash-table-wrapper {
    overflow-x: auto;
}

.mzts-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mzts-dash-table thead {
    background: #f5f5f5;
}

.mzts-dash-table th,
.mzts-dash-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.mzts-dash-table th {
    font-weight: 600;
    color: #333;
}

.mzts-dash-table tbody tr:hover {
    background: #fafafa;
}

/* Message */
.mzts-dash-message {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    color: #0d47a1;
    text-align: center;
    font-size: 16px;
}

/* Modal Overlay */
.mzts-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.mzts-modal-overlay.active {
    display: block;
}

/* Modal Container */
.mzts-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.mzts-modal.active {
    display: block;
}

/* Modal Header */
.mzts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: #fff;
    border-bottom: none;
}

.mzts-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.mzts-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.mzts-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.mzts-modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

/* Modal Footer */
.mzts-modal-footer {
    padding: 15px 25px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: left;
}

/* Updates Timeline in Modal */
.mzts-modal-body .mzts-updates-timeline-item {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-right: 4px solid #2196F3;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.mzts-modal-body .mzts-updates-timeline-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-3px);
}

.mzts-updates-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.mzts-updates-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.mzts-updates-notes {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-top: 10px;
}

.mzts-updates-file {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
}

.mzts-updates-file a {
    color: #1976D2;
    text-decoration: none;
    font-weight: 600;
}

.mzts-updates-file a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Better Button Styling */
.mzts-dash-btn-icon {
    margin-left: 5px;
    font-size: 16px;
}

/* Improved Table */
.mzts-dash-table tbody tr {
    transition: all 0.2s;
}

.mzts-dash-table tbody tr:hover {
    background: #f0f7ff;
    box-shadow: 0 1px 4px rgba(33, 150, 243, 0.1);
}

/* Card Improvements */
.mzts-dash-contract-card {
    transition: all 0.3s;
    border-right: 4px solid transparent;
}

.mzts-dash-contract-card:hover {
    border-right-color: #2196F3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(-2px);
}

/* Receipt Label in Transfers Tab */
.mz-reciept-label-transfers-tab {
    display: block;
    margin: 10px 0 5px;
    padding: 5px 8px;
    background: #f5f5f5;
    border-left: 3px solid #2196F3;
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

/* RTL Support */
[dir="rtl"] .mzts-dash-wrapper {
    direction: rtl;
}

[dir="rtl"] .mzts-modal-body .mzts-updates-timeline-item {
    border-right: none;
    border-left: 4px solid #2196F3;
}

[dir="rtl"] .mzts-modal-body .mzts-updates-timeline-item:hover {
    transform: translateX(3px);
}

[dir="rtl"] .mzts-dash-contract-card {
    border-right: none;
    border-left: 4px solid transparent;
}

[dir="rtl"] .mzts-dash-contract-card:hover {
    border-left-color: #2196F3;
    transform: translateX(2px);
}

[dir="rtl"] .mz-reciept-label-transfers-tab {
    border-left: none;
    border-right: 3px solid #2196F3;
}

/* Responsive */
@media (max-width: 768px) {
    .mzts-dash-wrapper {
        padding: 10px;
    }
    
    .mzts-dash-content {
        padding: 20px;
    }
    
    .mzts-dash-header h1 {
        font-size: 24px;
    }
    
    .mzts-dash-tabs {
        flex-direction: column;
    }
    
    .mzts-dash-tab {
        width: 100%;
    }
    
    .mzts-dash-contract-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mzts-dash-filter-row {
        flex-direction: column;
    }
    
    .mzts-dash-filter-group {
        width: 100%;
    }
    
    .mzts-dash-stats {
        grid-template-columns: 1fr;
    }
    
    /* Responsive Table - Card Layout on Mobile */
    .mzts-dash-table-wrapper {
        overflow-x: visible;
    }
    
    .mzts-dash-table,
    .mzts-dash-table thead,
    .mzts-dash-table tbody,
    .mzts-dash-table tr,
    .mzts-dash-table th,
    .mzts-dash-table td {
        display: block;
        width: 100%;
    }
    
    .mzts-dash-table thead {
        display: none;
    }
    
    .mzts-dash-table tr {
        margin-bottom: 20px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .mzts-dash-table td {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
    }
    
    .mzts-dash-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .mzts-dash-table td:first-child {
        padding-top: 0;
    }
    
    /* Add labels for mobile */
    .mzts-dash-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: #666;
        font-size: 11px;
        text-transform: uppercase;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }
    
    /* Mobile button improvements */
    .mzts-dash-btn {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    .mzts-dash-btn-small {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Status badges on mobile */
    .mzts-dash-status {
        display: inline-block !important;
        margin: 5px 5px 5px 0;
    }
    
    /* Receipt label mobile */
    .mz-reciept-label-transfers-tab {
        margin: 15px 0 8px;
        font-size: 13px;
    }
    
    /* Modal responsive */
    .mzts-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .mzts-modal-header {
        padding: 15px;
    }
    
    .mzts-modal-header h2 {
        font-size: 16px;
    }
    
    .mzts-modal-body {
        padding: 15px;
        max-height: calc(90vh - 130px);
    }
    
    .mzts-modal-close {
        font-size: 24px;
        padding: 4px 10px;
    }
}

