/**
 * Frontend Shortcodes CSS
 * Styles for timesheet shortcodes
 */

/* Base Styles */
.mw-frontend-timesheet-container,
.mw-frontend-timesheet-list-container,
.mw-frontend-timesheet-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.mw-frontend-timesheet-title {
    margin: 0 0 24px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 3px solid #0073aa;
}

/* Message Styles */
.mw-frontend-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.mw-frontend-notice.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mw-frontend-notice.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* Loading and Error States */
.mw-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.mw-loading p {
    margin: 0;
}

.mw-error {
    text-align: center;
    padding: 20px;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f1b0b7;
    border-radius: 4px;
}

.mw-error p {
    margin: 0;
    font-weight: 500;
}

/* Force Refresh Button */
.mw-dashboard-actions {
    text-align: center;
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
    margin-top: 16px;
}

#mw-frontend-force-refresh {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#mw-frontend-force-refresh:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#mw-frontend-force-refresh:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

#mw-frontend-force-refresh:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Bulk Actions */
.mw-frontend-list-actions {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.mw-bulk-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mw-bulk-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox Column */
.mw-check-column {
    width: 40px;
    text-align: center;
}

.mw-entry-checkbox {
    cursor: pointer;
}

/* Pagination Styles */
.mw-frontend-pagination {
    margin-top: 20px;
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.mw-frontend-pagination a,
.mw-frontend-pagination .mw-pagination-current {
    display: inline-block;
    margin: 0 4px;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.mw-frontend-pagination a:hover {
    background-color: #e9ecef;
}

.mw-pagination-current {
    background-color: #0073aa;
    color: white;
    font-weight: bold;
}

.mw-pagination-info {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Form Styles */
.mw-readonly-field {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.mw-field-help {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.mw-frontend-timesheet-form {
    max-width: 800px;
}

.mw-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.mw-form-group {
    position: relative;
}

.mw-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.mw-form-group label .required {
    color: #dc3232;
    margin-left: 3px;
}

.mw-form-group input,
.mw-form-group select,
.mw-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.mw-form-group input:focus,
.mw-form-group select:focus,
.mw-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mw-form-group input[readonly] {
    background-color: #f9f9f9;
    color: #666;
}

.mw-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button Styles */
.mw-form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mw-btn {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: none;
    outline: none;
}

.mw-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.mw-btn-primary {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.mw-btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #fff;
}

.mw-btn-secondary {
    background-color: #f7f7f7;
    border-color: #ccc;
    color: #333;
}

.mw-btn-secondary:hover {
    background-color: #e8e8e8;
    border-color: #999;
    color: #333;
}

.mw-btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.mw-btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

.mw-btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.mw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Filters */
.mw-frontend-timesheet-filters {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.mw-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    align-items: end;
}

.mw-filter-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.mw-filter-group select,
.mw-filter-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.mw-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Table Styles */
.mw-frontend-table-container {
    overflow-x: auto;
}

.mw-frontend-timesheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.mw-frontend-timesheet-table th,
.mw-frontend-timesheet-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mw-frontend-timesheet-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mw-frontend-timesheet-table tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.mw-status, .mw-sync-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mw-status-draft {
    background: #fef3cd;
    color: #856404;
}

.mw-status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.mw-status-approved {
    background: #d4edda;
    color: #155724;
}

/* Sync status badges */
.mw-sync-status-pending {
    background: #fff3cd;
    color: #664d03;
}

.mw-sync-status-synced {
    background: #d1e7dd;
    color: #0f5132;
}

.mw-sync-status-failed {
    background: #f8d7da;
    color: #721c24;
}

.mw-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mw-no-entries {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.mw-no-entries p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Dashboard Styles */
.mw-dashboard-stats {
    margin-bottom: 30px;
}

.mw-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mw-stat-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.mw-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mw-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mw-stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin: 0;
}

.mw-dashboard-recent {
    margin-bottom: 30px;
}

.mw-dashboard-recent h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

/* Recent Entries */
.mw-recent-entries {
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #f8f9fa;
}

.mw-recent-entry {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
}

.mw-recent-entry:last-child {
    border-bottom: none;
}

.mw-entry-date {
    width: 60px;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-align: center;
}

.mw-entry-details {
    flex: 1;
    margin-left: 15px;
}

.mw-entry-memo {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.mw-entry-status {
    margin-left: 15px;
}

/* Responsive Design */
@media (min-width: 768px) {
    .mw-form-row {
        grid-template-columns: 1fr 1fr;
    }

    .mw-form-group.mw-form-full {
        grid-column: 1 / -1;
    }

    .mw-form-half {
        /* Already handled by grid */
    }
}

@media (max-width: 767px) {
    .mw-frontend-timesheet-container,
    .mw-frontend-timesheet-list-container,
    .mw-frontend-timesheet-dashboard {
        padding: 16px;
        margin-bottom: 16px;
    }

    .mw-frontend-timesheet-title {
        font-size: 20px;
    }

    .mw-frontend-timesheet-table,
    .mw-frontend-timesheet-table thead,
    .mw-frontend-timesheet-table tbody,
    .mw-frontend-timesheet-table th,
    .mw-frontend-timesheet-table td,
    .mw-frontend-timesheet-table tr {
        display: block;
    }

    .mw-frontend-timesheet-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .mw-frontend-timesheet-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        border-radius: 6px;
        background: #fff;
        padding: 16px;
    }

    .mw-frontend-timesheet-table td {
        border: none;
        position: relative;
        padding: 8px 0 8px 120px;
        min-height: 24px;
    }

    .mw-frontend-timesheet-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        width: 110px;
        font-weight: 600;
        color: #333;
        white-space: nowrap;
    }

    .mw-filter-row {
        grid-template-columns: 1fr;
    }

    .mw-filter-actions {
        grid-column: 1;
        justify-content: stretch;
    }

    .mw-filter-actions .mw-btn {
        flex: 1;
    }

    .mw-stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .mw-stat-number {
        font-size: 24px;
    }

    .mw-action-buttons {
        flex-direction: column;
    }

    .mw-recent-entry {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .mw-entry-date {
        width: auto;
        margin-bottom: 5px;
    }

    .mw-entry-details {
        margin-left: 0;
        margin-bottom: 5px;
    }

    .mw-entry-status {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .mw-stat-cards {
        grid-template-columns: 1fr;
    }

    .mw-form-actions {
        flex-direction: column;
    }

    .mw-form-actions .mw-btn {
        width: 100%;
        text-align: center;
    }
}