/* HRM Availability Manager - Frontend Styles */

.hrm-availability-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Calendar Frontend */
.hrm-calendar {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hrm-calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    padding: 20px;
}

.hrm-calendar-header h3 {
    margin: 0;
    font-size: 20px;
    text-align: center;
}

.hrm-nav-prev,
.hrm-nav-next {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
}

.hrm-nav-prev:hover,
.hrm-nav-next:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.hrm-nav-disabled {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    pointer-events: none;
}

.hrm-nav-disabled:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Calendar Controls - Month Selector */
.hrm-calendar-controls {
    background: #f5f5f5;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.hrm-month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrm-month-selector label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.hrm-month-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.hrm-month-select:hover {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.hrm-month-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Calendar Table */
.hrm-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.hrm-calendar-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.hrm-calendar-table td {
    border: 1px solid #eee;
    padding: 12px;
    text-align: center;
    height: 100px;
    position: relative;
    background: #fafafa;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    vertical-align: top;
}

.hrm-calendar-table td:hover {
    background: #e8f4f8;
    box-shadow: inset 0 0 8px rgba(0, 115, 170, 0.1);
}

.hrm-calendar-table td.hrm-available {
    background: linear-gradient(135deg, #d4edda 0%, #c8e6c9 100%);
    color: #155724;
}

.hrm-calendar-table td.hrm-unavailable {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.hrm-calendar-table td.hrm-maintenance {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #856404;
}

.hrm-calendar-table td.hrm-not-set {
    background: #e2e3e5;
    color: #383d41;
}

.hrm-calendar-table td.hrm-empty {
    background: #f0f0f0;
    cursor: default;
}

.hrm-day-number {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.hrm-availability-info {
    font-size: 12px;
    color: inherit;
    margin-top: 4px;
    font-weight: normal;
    line-height: 1.2;
}

/* Calendar Legend */
.hrm-calendar-legend {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
    justify-content: center;
}

.hrm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.hrm-legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.hrm-legend-available .hrm-legend-color {
    background: linear-gradient(135deg, #d4edda 0%, #c8e6c9 100%);
    border-color: #28a745;
}

.hrm-legend-unavailable .hrm-legend-color {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
}

.hrm-legend-not-set .hrm-legend-color {
    background: #e2e3e5;
    border-color: #6c757d;
}

.hrm-legend-text {
    font-weight: 500;
    color: #333;
}

/* Availability Display */
.hrm-availability-available {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.hrm-availability-unavailable {
    display: inline-block;
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

/* Detailed View */
.hrm-availability-detailed {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.hrm-avail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.hrm-avail-row:last-child {
    border-bottom: none;
}

.hrm-avail-label {
    font-weight: 600;
    color: #333;
}

.hrm-avail-value {
    color: #0073aa;
    font-weight: bold;
    font-size: 16px;
}

/* Occupancy Percentage */
.hrm-availability-percentage {
    margin: 15px 0;
}

.hrm-occupancy-bar {
    width: 100%;
    height: 24px;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.hrm-occupancy-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c63ff, #0073aa);
    transition: width 0.3s ease;
}

.hrm-occupancy-fill-low {
    background: linear-gradient(90deg, #95de64, #51cf66);
}

.hrm-occupancy-fill-medium {
    background: linear-gradient(90deg, #ffb612, #ff9b00);
}

.hrm-occupancy-fill-high {
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
}

.hrm-occupancy-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hrm-availability-percentage.hrm-occupancy-low .hrm-occupancy-fill {
    background: linear-gradient(90deg, #95de64, #51cf66);
}

.hrm-availability-percentage.hrm-occupancy-medium .hrm-occupancy-fill {
    background: linear-gradient(90deg, #ffb612, #ff9b00);
}

.hrm-availability-percentage.hrm-occupancy-high .hrm-occupancy-fill {
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
}

/* Error Messages */
.hrm-availability-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px 15px;
    margin: 15px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hrm-calendar-table th,
    .hrm-calendar-table td {
        padding: 8px;
        height: 80px;
        font-size: 14px;
    }

    .hrm-day-number {
        font-size: 16px;
    }

    .hrm-availability-info {
        font-size: 11px;
    }

    .hrm-calendar-header {
        flex-direction: column;
        gap: 10px;
    }

    .hrm-calendar-header h3 {
        font-size: 18px;
    }

    .hrm-nav-prev,
    .hrm-nav-next {
        padding: 6px 10px;
        font-size: 12px;
    }

    .hrm-calendar-controls {
        padding: 12px 15px;
        gap: 10px;
    }

    .hrm-month-selector {
        gap: 8px;
        width: 100%;
    }

    .hrm-month-select {
        flex: 1;
        min-width: 150px;
    }

    .hrm-calendar-legend {
        gap: 15px;
        padding: 12px 15px;
    }

    .hrm-availability-detailed {
        padding: 10px;
    }

    .hrm-avail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .hrm-calendar-table th,
    .hrm-calendar-table td {
        padding: 6px;
        height: 60px;
        font-size: 12px;
    }

    .hrm-day-number {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .hrm-availability-info {
        font-size: 10px;
    }

    .hrm-calendar-header h3 {
        font-size: 16px;
    }

    .hrm-calendar-legend {
        gap: 10px;
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .hrm-month-selector label {
        display: block;
        margin-bottom: 5px;
        width: 100%;
    }

    .hrm-month-select {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .hrm-nav-prev,
    .hrm-nav-next,
    .hrm-quick-actions,
    .hrm-action-buttons,
    .hrm-calendar-controls {
        display: none;
    }

    .hrm-calendar-table {
        border-collapse: collapse;
    }

    .hrm-calendar-table td,
    .hrm-calendar-table th {
        page-break-inside: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    .hrm-calendar,
    .hrm-availability-detailed,
    .hrm-calendar-controls {
        background: #2d2d2d;
        border-color: #444;
    }

    .hrm-calendar-table th {
        background: #3d3d3d;
        color: #eee;
    }

    .hrm-calendar-table td {
        background: #2d2d2d;
        color: #eee;
        border-color: #444;
    }

    .hrm-avail-label,
    .hrm-occupancy-bar,
    .hrm-month-select {
        background: #3d3d3d;
        border-color: #444;
        color: #eee;
    }

    .hrm-occupancy-text {
        color: #eee;
    }

    .hrm-calendar-legend {
        background: #3d3d3d;
        border-color: #444;
    }

    .hrm-legend-text {
        color: #eee;
    }

    .hrm-month-selector label {
        color: #eee;
    }
}
