/* UTJD Timesheet Manager Styles */

/* Form Wrapper */
.utjd-timesheet-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.utjd-timesheet-wrapper h2 {
    margin-top: 0;
    color: #23282d;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Notices */
.utjd-notice {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.utjd-notice-info {
    background-color: #d9edf7;
    border-color: #31708f;
    color: #31708f;
}

.utjd-notice-success {
    background-color: #dff0d8;
    border-color: #3c763d;
    color: #3c763d;
}

.utjd-notice-error {
    background-color: #f2dede;
    border-color: #a94442;
    color: #a94442;
}

/* Form Styles */
.utjd-form {
    margin-top: 20px;
}

.utjd-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.utjd-form-group {
    margin-bottom: 20px;
}

.utjd-form-row .utjd-form-group {
    flex: 1;
    margin-bottom: 0;
}

.utjd-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
}

.utjd-form-group input[type="text"],
.utjd-form-group input[type="number"],
.utjd-form-group select,
.utjd-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.utjd-form-group input[type="text"]:focus,
.utjd-form-group input[type="number"]:focus,
.utjd-form-group select:focus,
.utjd-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.utjd-form-group input[type="file"] {
    padding: 5px;
}

.utjd-checkbox {
    display: block;
    margin: 8px 0;
    font-weight: normal;
}

.utjd-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.utjd-help-text {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.utjd-existing-file {
    margin-top: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 13px;
}

.required {
    color: #dc3232;
}

/* Buttons */
.utjd-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.utjd-btn-primary:hover {
    background-color: #005a87;
}

.utjd-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Status Badges */
.utjd-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.utjd-badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.utjd-badge-approved {
    background-color: #d4edda;
    color: #155724;
}

.utjd-badge-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.utjd-badge-draft {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Leave Entries Display (Admin View) */
.utjd-leave-entries-display {
    margin: 10px 0;
}

.utjd-leave-entry-item {
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid #0073aa;
    font-size: 13px;
    line-height: 1.6;
}

.utjd-leave-entry-item:last-child {
    margin-bottom: 0;
}

/* Messages */
#utjd-form-message {
    margin-top: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    display: none;
}

#utjd-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#utjd-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Admin Styles */
.utjd-reject-btn {
    color: #a00;
}

.utjd-reject-btn:hover {
    color: #dc3232;
}

/* Modal Styles */
#utjd-reject-modal,
#utjd-project-modal,
#utjd-view-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    max-width: 500px;
    width: 90%;
    display: none;
}

.utjd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .utjd-form-row {
        flex-direction: column;
    }
    
    .utjd-timesheet-wrapper {
        padding: 20px;
    }
    
    .utjd-calendar-table {
        font-size: 12px;
    }
    
    .utjd-calendar-table .day-hours {
        font-size: 12px;
        padding: 3px;
    }
}

/* Calendar Table Styles */
.utjd-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.utjd-calendar-table thead {
    background: #0073aa;
    color: #fff;
}

.utjd-calendar-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.utjd-calendar-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: top;
    min-height: 80px;
    position: relative;
}

.utjd-calendar-table td.empty {
    background: #f9f9f9;
}

.utjd-calendar-table .day-cell {
    background: #fff;
    min-height: 70px;
}

.utjd-calendar-table .day-number {
    font-weight: 600;
    color: #23282d;
    margin-bottom: 5px;
    font-size: 14px;
}

.utjd-calendar-table .day-hours {
    width: 90%;
    max-width: 70px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 3px;
}

.utjd-calendar-table .day-hours:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.utjd-calendar-table label {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    margin: 0;
}

#utjd-calendar-container {
    overflow-x: auto;
}

/* Button Secondary Style */
.utjd-btn-secondary {
    background-color: #f7f7f7;
    color: #555;
    border: 1px solid #ccc;
    margin-right: 10px;
}

.utjd-btn-secondary:hover {
    background-color: #e7e7e7;
}

/* Leave Entries Styles */
.leave-entry {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
    background: #f9f9f9;
    position: relative;
}

.leave-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.leave-entry-header h4 {
    margin: 0;
    color: #0073aa;
    font-size: 16px;
}

.remove-leave-btn {
    background: #dc3232;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.3s;
}

.remove-leave-btn:hover {
    background: #a00;
}

.leave-entry-fields {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}

#leave-entries-container {
    margin-bottom: 15px;
}

#add-leave-btn {
    width: 100%;
    margin-top: 10px;
}

.leave-entry .utjd-form-row .utjd-form-group {
    margin-bottom: 0;
}

.leave-entry .utjd-form-group {
    margin-bottom: 15px;
}

.leave-entry .utjd-form-group:last-child {
    margin-bottom: 0;
}

/* Admin View Modal Styles */
.utjd-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.utjd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
}

.utjd-modal-content {
    padding: 30px;
}

.utjd-modal-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.utjd-timesheet-details {
    color: #333;
}

.utjd-detail-header {
    border-bottom: 3px solid #0073aa;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.utjd-detail-header h2 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 24px;
}

.utjd-detail-meta {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.utjd-detail-meta .separator {
    margin: 0 10px;
}

.utjd-detail-section {
    margin-bottom: 30px;
}

.utjd-detail-section h3 {
    background: #f1f1f1;
    padding: 10px 15px;
    margin: 0 0 15px 0;
    font-size: 18px;
    border-left: 4px solid #0073aa;
}

.utjd-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.utjd-detail-table th,
.utjd-detail-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.utjd-detail-table th {
    background: #f9f9f9;
    font-weight: bold;
    width: 200px;
}

.utjd-calendar-view {
    width: 100%;
    border-collapse: collapse;
}

.utjd-calendar-view th,
.utjd-calendar-view td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.utjd-calendar-view thead th {
    background: #0073aa;
    color: #fff;
    font-weight: bold;
}

.utjd-calendar-view tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.utjd-detail-content {
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    line-height: 1.6;
}

.utjd-leave-detail {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #0073aa;
}

.utjd-leave-detail h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 16px;
}

.utjd-rejection {
    border-left-color: #dc3545;
}

.utjd-rejection h3 {
    border-left-color: #dc3545;
}

.utjd-rejection .utjd-detail-content {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.utjd-detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e5e5;
    text-align: right;
}

.utjd-detail-actions .button {
    margin-left: 10px;
}

.utjd-detail-actions .dashicons {
    vertical-align: middle;
}
