/* Calendar Styles - Modern UI/UX Design */

.calendar-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-top: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.calendar-view-toggle {
    display: flex;
    gap: 8px;
}

.calendar-view-toggle .btn {
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.calendar-view-toggle .btn.active {
    background: #49ab7c;
    color: white;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.legend-text {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* Filter Bar */
.calendar-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e5e7eb;
}

.calendar-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}

.calendar-filter-label i {
    color: #49ab7c;
}

.calendar-filter-buttons {
    display: flex;
    gap: 8px;
    flex: 1;
}

.calendar-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px solid #d1d5db;
    background: white;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.calendar-filter-btn:hover {
    border-color: #49ab7c;
    color: #49ab7c;
    background: #f0fdf4;
}

.calendar-filter-btn.active {
    background: #49ab7c;
    border-color: #49ab7c;
    color: white;
}

.calendar-filter-btn.calendar-add-btn {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.calendar-filter-btn.calendar-add-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
}

.calendar-filter-btn i {
    font-size: 14px;
}

.calendar-filter-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.calendar-create-event {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.calendar-create-event h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #1f2937;
}

.calendar-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.calendar-create-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.calendar-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.calendar-legend-text {
    font-weight: 500;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-navigation h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    min-width: 250px;
    text-align: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #d1d5db;
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
    background: #49ab7c;
    border-color: #49ab7c;
    color: white;
    box-shadow: 0 2px 4px rgba(73, 171, 124, 0.2);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Month View */
.calendar-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-weekday {
    background: #f9fafb;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    overflow: hidden;
    /* Prevent content from expanding cell */
}

.calendar-day:hover {
    background: #f9fafb;
}

.calendar-day.other-month {
    background: #fafafa;
    opacity: 0.5;
}

.calendar-day.today {
    background: #f0fdf4;
}

.calendar-day.weekend {
    background: #fafafa;
}

.calendar-day.holiday {
    background: #fef2f2;
}

.calendar-day.holiday.today {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef2f2 100%);
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.calendar-day.holiday .calendar-day-number {
    color: #dc2626;
}

.calendar-holiday-name {
    font-size: 11px;
    font-weight: 600;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day.today .calendar-day-number {
    display: inline-block;
    background: #49ab7c;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-event {
    background: #49ab7c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    text-decoration: none;
    align-items: center;
    gap: 4px;
    min-width: 0;
    /* Important for flex child truncation */
}

.calendar-event-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.calendar-event.event-type-task {
    background: #3b82f6;
}

.calendar-event.event-type-task:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.calendar-event.event-type-installation {
    background: #49ab7c;
}

.calendar-event.event-type-installation:hover {
    background: #3d9268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(73, 171, 124, 0.3);
}

.calendar-event.event-type-custom {
    background: #f59e0b;
}

.calendar-event.event-type-custom:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.calendar-event:hover {
    transform: translateY(-1px);
}

.calendar-event i {
    font-size: 10px;
}

.calendar-event-more {
    color: #6b7280;
    font-size: 11px;
    padding: 2px 4px;
    cursor: pointer;
}

.calendar-event-more:hover {
    color: #49ab7c;
}

/* Week View */
.calendar-week {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-week-time {
    background: #f9fafb;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
}

.calendar-week-header {
    background: #f9fafb;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.calendar-week-header.today {
    background: #f0fdf4;
    color: #49ab7c;
}

.calendar-week-header.holiday {
    background: #fef2f2;
    color: #dc2626;
}

.calendar-week-header.holiday.today {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef2f2 100%);
}

.calendar-week-holiday {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    color: #dc2626;
}

.calendar-week-day {
    background: white;
    padding: 8px;
    min-height: 80px;
    position: relative;
    overflow: hidden;
    /* Prevent content from expanding cell */
}

.calendar-week-day.today {
    background: #f0fdf4;
}

.calendar-week-day.holiday {
    background: #fef2f2;
}

.calendar-week-day.holiday.today {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef2f2 100%);
}

.calendar-week-event {
    background: #49ab7c;
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.calendar-week-event.event-type-task {
    background: #3b82f6;
}

.calendar-week-event.event-type-task:hover {
    background: #2563eb;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.calendar-week-event.event-type-installation {
    background: #49ab7c;
}

.calendar-week-event.event-type-installation:hover {
    background: #3d9268;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(73, 171, 124, 0.3);
}

.calendar-week-event.event-type-custom {
    background: #f59e0b;
}

.calendar-week-event.event-type-custom:hover {
    background: #d97706;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.calendar-week-event:hover {
    transform: translateX(2px);
}

.calendar-week-event-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-week-event-details {
    font-size: 11px;
    opacity: 0.9;
}

/* Event Tooltip */
.calendar-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 250px;
    display: none;
}

.calendar-tooltip.show {
    display: block;
}

.calendar-tooltip-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 8px;
}

.calendar-tooltip-detail {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-tooltip-detail i {
    width: 16px;
    color: #49ab7c;
}

/* Loading State */
.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #6b7280;
}

.calendar-loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.calendar-empty {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.calendar-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.calendar-empty h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #374151;
}

.calendar-empty p {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calendar-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .calendar-filter-buttons {
        flex-direction: column;
    }

    .calendar-filter-legend {
        justify-content: center;
    }

    .calendar-create-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .calendar-view-toggle {
        flex-direction: column;
    }

    .calendar-navigation {
        flex-wrap: wrap;
    }

    .calendar-navigation h2 {
        width: 100%;
        order: -1;
        margin-bottom: 12px;
    }

    .calendar-filter-bar {
        padding: 12px;
    }

    .calendar-filter-label {
        font-size: 13px;
    }

    .calendar-filter-btn {
        font-size: 13px;
        padding: 8px 12px;
    }

    .calendar-filter-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .calendar-day {
        min-height: 80px;
    }

    .calendar-event {
        font-size: 10px;
        padding: 2px 4px;
    }

    .calendar-week {
        grid-template-columns: 60px repeat(7, 1fr);
    }
}

/* Year View Styles */
.calendar-year {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.calendar-mini-month {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    border: 2px solid #e5e7eb;
}

.calendar-mini-month-header {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.calendar-mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-mini-weekday {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    padding: 4px 0;
}

.calendar-mini-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #374151;
    border-radius: 4px;
    background: white;
    border: 1px solid #e5e7eb;
}

.calendar-mini-day-empty {
    background: transparent;
    border: none;
}

.calendar-mini-day-has-event {
    background: #49ab7c;
    color: white;
    font-weight: 600;
}

/* Review Details */
.review-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.review-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #374151;
}

.review-details strong {
    color: #1f2937;
    font-weight: 600;
}

/* Leave Requests Tables */
.leave-requests-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

/* Leave Requests Filter */
.leave-requests-filter {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.leave-requests-filter .filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leave-requests-filter label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    margin: 0;
}

.leave-requests-filter label i {
    color: #49ab7c;
    margin-right: 6px;
}

.leave-requests-filter .form-select {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.leave-requests-filter .form-select:hover {
    border-color: #49ab7c;
}

.leave-requests-filter .form-select:focus {
    outline: none;
    border-color: #49ab7c;
    box-shadow: 0 0 0 3px rgba(73, 171, 124, 0.1);
}

.leave-requests-filter .form-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.leave-requests-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.leave-requests-section h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leave-requests-section h3::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 16px;
}

.leave-requests-section h3 .count-badge {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.leave-requests-section:nth-child(2) h3 {
    background: #fef3c7;
    border-bottom-color: #fbbf24;
    color: #92400e;
}

.leave-requests-section:nth-child(2) h3::before {
    content: '\f017';
    /* clock icon */
    color: #f59e0b;
}

.leave-requests-section:nth-child(3) h3 {
    background: #d1fae5;
    border-bottom-color: #49ab7c;
    color: #065f46;
}

.leave-requests-section:nth-child(3) h3::before {
    content: '\f00c';
    /* check icon */
    color: #49ab7c;
}

.leave-requests-section:nth-child(4) h3 {
    background: #fee2e2;
    border-bottom-color: #ef4444;
    color: #991b1b;
}

.leave-requests-section:nth-child(4) h3::before {
    content: '\f00d';
    /* times icon */
    color: #ef4444;
}

.table-container {
    overflow-x: auto;
}

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

.data-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 16px;
    color: #374151;
    vertical-align: middle;
}

.data-table td:first-child {
    font-weight: 500;
    color: #1f2937;
}

/* Empty state and loading */
.text-center {
    text-align: center;
}

.text-muted {
    color: #9ca3af;
    font-style: italic;
    padding: 32px 16px !important;
}

/* Action buttons */
.data-table .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 36px;
}

.data-table .btn-sm i {
    font-size: 12px;
}

.data-table .btn-success {
    background: #49ab7c;
    color: white;
}

.data-table .btn-success:hover {
    background: #3d9268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(73, 171, 124, 0.3);
}

.data-table .btn-danger {
    background: #ef4444;
    color: white;
}

.data-table .btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.data-table .btn-sm:active {
    transform: translateY(0);
}

.data-table td:last-child {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Leave type badges */
.leave-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.leave-type-badge.szabadsag {
    background: #d1fae5;
    color: #065f46;
}

.leave-type-badge.betegseg {
    background: #fed7aa;
    color: #92400e;
}

.leave-type-badge.fizetesnelkuli {
    background: #e5e7eb;
    color: #374151;
}

/* Days count badge */
.days-count {
    font-weight: 600;
    color: #49ab7c;
}

/* Delete Confirmation Modal */
.modal-sm {
    max-width: 500px;
}

.delete-confirmation {
    text-align: center;
    padding: 20px 0;
}

.warning-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 20px;
}

.confirmation-text {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.delete-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    text-align: left;
}

.delete-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #374151;
}

.delete-details strong {
    color: #1f2937;
    font-weight: 600;
}

.info-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.info-text i {
    color: #3b82f6;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Responsive Design for Tables */
@media (max-width: 1200px) {
    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .leave-requests-section h3 {
        padding: 16px 20px;
        font-size: 16px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .data-table .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    .table-container {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .leave-requests-filter .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .leave-requests-filter .form-select {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .leave-requests-container {
        gap: 16px;
        margin-top: 24px;
    }

    .leave-requests-section h3 {
        padding: 12px 16px;
        font-size: 15px;
    }

    .data-table th {
        font-size: 11px;
        padding: 10px 6px;
    }

    .data-table td {
        padding: 10px 6px;
        font-size: 11px;
    }

    .leave-type-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .data-table .btn-sm {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 28px;
    }
}
