/* SafeShipper Frontend Styles */

.safeshipper-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.safeshipper-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.safeshipper-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.safeshipper-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.safeshipper-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-card h3 {
    font-size: 2.5em;
    margin: 0 0 5px 0;
    color: #667eea;
    font-weight: 600;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}

.safeshipper-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.safeshipper-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.safeshipper-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.safeshipper-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.safeshipper-btn-primary {
    background: #667eea;
    color: white;
}

.safeshipper-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.safeshipper-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.safeshipper-btn-secondary:hover {
    background: #cbd5e0;
}

.safeshipper-btn-success {
    background: #48bb78;
    color: white;
}

.safeshipper-btn-success:hover {
    background: #38a169;
}

.safeshipper-btn-warning {
    background: #ed8936;
    color: white;
}

.safeshipper-btn-warning:hover {
    background: #dd6b20;
}

.safeshipper-btn-danger {
    background: #f56565;
    color: white;
}

.safeshipper-btn-danger:hover {
    background: #e53e3e;
}

.safeshipper-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.order-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.order-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-order_placed { background: #fef5e7; color: #744210; }
.status-order_packed { background: #e6fffa; color: #234e52; }
.status-order_shipped { background: #ebf8ff; color: #2c5282; }
.status-order_at_customs { background: #faf5ff; color: #553c9a; }
.status-order_paid_at_customs { background: #f0fff4; color: #22543d; }
.status-completed { background: #f0fff4; color: #22543d; }
.status-issues { background: #fed7d7; color: #c53030; }

.order-meta p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.order-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.order-actions .safeshipper-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
}

.issue-notice {
    color: #c53030 !important;
    font-weight: 600;
}

.safeshipper-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.safeshipper-error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Order Detail View */
.safeshipper-order-view {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-progress {
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #e2e8f0;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: #667eea;
    border-color: #667eea;
}

.progress-step.current .step-circle {
    background: #48bb78;
    border-color: #48bb78;
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.2);
}

.step-label {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
    color: #666;
    max-width: 80px;
}

.progress-step.active .step-label {
    color: #333;
    font-weight: 500;
}

.completion-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Spreadsheet Styles */
.safeshipper-data-table {
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.table-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.spreadsheet-container {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    max-height: 400px;
}

.safeshipper-spreadsheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.spreadsheet-cell {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    min-width: 120px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.spreadsheet-cell:hover {
    background: #f7fafc;
}

.spreadsheet-cell.editable-by-receiver {
    background: #f0fff4;
    border-color: #9ae6b4;
}

.spreadsheet-cell.owner-only {
    background: #fed7d7;
    border-color: #feb2b2;
}

.spreadsheet-cell.editing {
    background: #ebf8ff;
    border-color: #667eea;
}

.spreadsheet-cell input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
    font-size: inherit;
}

.spreadsheet-cell input:focus {
    outline: none;
}

/* Receivers Section */
.receivers-section {
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.receivers-list {
    margin-bottom: 20px;
}

.receiver-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    margin-bottom: 10px;
}

.add-receiver-form {
    background: #f7fafc;
    padding: 20px;
    border-radius: 5px;
}

.add-receiver-form .form-group {
    display: flex;
    gap: 10px;
    align-items: end;
}

.add-receiver-form input {
    flex: 1;
}

/* Activity Log */
.activity-log {
    padding: 30px;
}

.log-entries {
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    display: grid;
    grid-template-columns: 120px 80px 150px 1fr;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
}

.log-time {
    color: #666;
    font-size: 12px;
}

.log-user {
    font-weight: 500;
    text-transform: capitalize;
}

.log-action {
    color: #667eea;
    font-weight: 500;
}

.log-details {
    color: #666;
}

/* Context Menu */
.cell-context-menu {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 200px;
}

.cell-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 5px 0;
}

.cell-context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cell-context-menu li:hover {
    background: #f7fafc;
}

/* Receiver Login */
.safeshipper-login {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.safeshipper-login h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.safeshipper-login .form-group {
    margin-bottom: 20px;
}

.safeshipper-login .safeshipper-btn {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .safeshipper-dashboard {
        padding: 10px;
    }
    
    .safeshipper-stats {
        grid-template-columns: 1fr;
    }
    
    .safeshipper-orders-grid {
        grid-template-columns: 1fr;
    }
    
    .order-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-bar::before {
        display: none;
    }
    
    .completion-actions {
        flex-direction: column;
    }
    
    .log-entry {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .add-receiver-form .form-group {
        flex-direction: column;
    }
}
