/* Base Container Styles */
.hsm-shifts-container {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.hsm-shift-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.hsm-shift-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.hsm-doctor-name {
    color: #2c5aa0;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.hsm-shift-details p {
    margin: 8px 0;
}

.hsm-ics-button {
    display: inline-block;
    background: #2c5aa0;
    color: white !important;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.hsm-ics-button:hover {
    background: #1e3d6f;
}

/* Calendar Base Styles */
.hsm-calendar-wrapper {
    display: grid;
    gap: 30px;
    margin: 20px 0;
}

.hsm-calendar-month {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hsm-calendar-title {
    text-align: center;
    margin: 0 0 20px 0;
    color: #2c3338;
    font-size: 1.4em;
    font-weight: 600;
}

.hsm-calendar-container {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

.hsm-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: #666;
}

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

.hsm-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.hsm-calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #0073aa;
    z-index: 10;
}

.hsm-calendar-day.empty {
    background: transparent;
    cursor: default;
}

.hsm-calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.hsm-calendar-day.today {
    border: 2px solid #0073aa !important;
}

.hsm-calendar-day.has-shift {
    background-color: #dc3232 !important;
    color: white;
}

.hsm-calendar-day.has-shift .hsm-day-number {
    color: white !important;
    font-weight: bold;
}

.hsm-day-number {
    font-size: 14px;
    font-weight: 500;
}

.hsm-shift-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: inherit;
}

/* ΚΕΝΤΡΙΚΟ Tooltip Styles - FIXED */
.hsm-shift-tooltip {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-color: #33484e;
    color: #fff9ee;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 100000;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid var(--today-color, #0073aa);
    animation: hsmTooltipFadeIn 0.3s ease-out;
}

@keyframes hsmTooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.hsm-tooltip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(212,212,212,59%);
    border: none;
    color: red;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100001;
    line-height: 1;
    padding: 0;
}

.hsm-tooltip-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.hsm-tooltip-title {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
    color: inherit;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
    padding-right: 30px; /* Χώρος για το κουμπί close */
}

/* ΜΟΝΟ ΕΝΑ TITLE - αφαιρέστε επιπλέον titles */
.hsm-tooltip-meta {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.hsm-tooltip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.hsm-tooltip-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.hsm-tooltip-notes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-style: italic;
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Overlay για το tooltip */
.hsm-tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    animation: hsmOverlayFadeIn 0.3s ease-out;
}

@keyframes hsmOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* List View Styles */
.hsm-list-view {
    display: grid;
    gap: 15px;
}

.hsm-list-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 15px;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.hsm-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hsm-list-date {
    text-align: center;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    min-width: 80px;
}

.hsm-list-day {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #dc3232;
    line-height: 1;
}

.hsm-list-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    margin: 2px 0;
}

.hsm-list-year {
    display: block;
    font-size: 11px;
    color: #999;
}

.hsm-list-content {
    flex: 1;
}

.hsm-list-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #2c3338;
}

.hsm-list-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.hsm-list-department {
    background: #e7f3ff;
    color: #0073aa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.hsm-list-notes {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 14px;
}

.hsm-list-phone {
    text-align: center;
    color: #0073aa;
    font-weight: 500;
}

.hsm-phone-icon {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
}

.hsm-phone-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.hsm-phone-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.hsm-phone-text {
    color: #666;
}

.hsm-no-shifts {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Calendar Navigation */
.hsm-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hsm-calendar-prev,
.hsm-calendar-next {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hsm-calendar-prev:hover:not(:disabled),
.hsm-calendar-next:hover:not(:disabled) {
    background: #005a87;
    transform: scale(1.1);
}

.hsm-calendar-prev:disabled,
.hsm-calendar-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.hsm-calendar-current-range {
    font-weight: bold;
    color: #2c3338;
    font-size: 16px;
    text-align: center;
    flex: 1;
    padding: 0 15px;
}

/* Calendar Columns Layout */
.hsm-calendar-wrapper.hsm-columns-1 {
    grid-template-columns: 1fr;
}

.hsm-calendar-wrapper.hsm-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.hsm-calendar-wrapper.hsm-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.hsm-calendar-month.hsm-month-hidden {
    display: none;
}

/* Pagination Styles */
.hsm-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 15px;
}

.hsm-pagination-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hsm-pagination a,
.hsm-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.hsm-pagination a {
    background: white;
    color: #0073aa;
}

.hsm-pagination a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

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

.hsm-pagination-prev,
.hsm-pagination-next {
    white-space: nowrap;
}

.hsm-list-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Notification Popup */
.hsm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3338;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 300px;
    animation: hsmSlideIn 0.3s ease-out;
}

.hsm-notification.success {
    background: #46b450;
}

.hsm-notification.error {
    background: #dc3232;
}

.hsm-notification.info {
    background: #0073aa;
}

@keyframes hsmSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes hsmSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.hsm-notification.hiding {
    animation: hsmSlideOut 0.3s ease-in;
}

/* Loading States */
.hsm-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.hsm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: hsmSpin 1s linear infinite;
}

@keyframes hsmSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hsm-calendar-wrapper.hsm-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hsm-shift-tooltip {
        max-width: 85%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .hsm-calendar-wrapper.hsm-columns-2,
    .hsm-calendar-wrapper.hsm-columns-3 {
        grid-template-columns: 1fr;
    }
    
    .hsm-calendar-navigation {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .hsm-calendar-prev,
    .hsm-calendar-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .hsm-calendar-current-range {
        order: -1;
        padding: 0;
    }
    
    .hsm-list-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 10px;
    }
    
    .hsm-list-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hsm-pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .hsm-pagination-numbers {
        order: 2;
    }
    
    .hsm-pagination-prev {
        order: 1;
    }
    
    .hsm-pagination-next {
        order: 3;
    }
    
    .hsm-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .hsm-shift-tooltip {
        max-width: 95%;
        padding: 15px;
        max-height: 85vh;
    }
    
    .hsm-calendar-header div {
        font-size: 12px;
    }
    
    .hsm-day-number {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hsm-shift-tooltip {
        max-width: 98%;
        padding: 12px;
    }
    
    .hsm-tooltip-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .hsm-tooltip-icon {
        align-self: flex-start;
    }
}



/* Mobile-First Calendar Navigation */
.hsm-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 15px;
}

.hsm-calendar-prev,
.hsm-calendar-next {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hsm-calendar-prev:hover:not(:disabled),
.hsm-calendar-next:hover:not(:disabled) {
    background: #005a87;
    transform: scale(1.1);
}

.hsm-calendar-prev:disabled,
.hsm-calendar-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.hsm-calendar-current-range {
    font-weight: bold;
    color: #2c3338;
    font-size: 16px;
    text-align: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hsm-calendar-navigation {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px;
        gap: 10px;
    }
    
    .hsm-calendar-prev,
    .hsm-calendar-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
        order: 1;
    }
    
    .hsm-calendar-prev {
        order: 1;
    }
    
    .hsm-calendar-next {
        order: 3;
    }
    
    .hsm-calendar-current-range {
        order: 2;
        font-size: 14px;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .hsm-calendar-navigation {
        padding: 10px;
        gap: 8px;
    }
    
    .hsm-calendar-prev,
    .hsm-calendar-next {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .hsm-calendar-current-range {
        font-size: 13px;
    }
}

/* List View Fixes */
.hsm-list-view {
    display: grid;
    gap: 15px;
}

.hsm-list-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 15px;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.hsm-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Mobile List View */
@media (max-width: 768px) {
    .hsm-list-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 12px;
    }
    
    .hsm-list-date {
        order: 1;
    }
    
    .hsm-list-content {
        order: 2;
    }
    
    .hsm-list-phone {
        order: 3;
    }
    
    .hsm-list-meta {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Tooltip Mobile Optimization */
@media (max-width: 768px) {
    .hsm-shift-tooltip {
        max-width: 95vw;
        max-height: 80vh;
        padding: 20px;
        margin: 10px;
    }
    
    .hsm-tooltip-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .hsm-shift-tooltip {
        max-width: 98vw;
        padding: 15px;
    }
}

/* Calendar Mobile Optimization */
@media (max-width: 768px) {
    .hsm-calendar-wrapper.hsm-columns-2,
    .hsm-calendar-wrapper.hsm-columns-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hsm-calendar-month {
        padding: 15px;
    }
    
    .hsm-calendar-container {
        padding: 10px;
    }
    
    .hsm-calendar-header div {
        font-size: 11px;
        padding: 5px 2px;
    }
    
    .hsm-day-number {
        font-size: 12px;
    }
}






/* Next Shift Widget - Single Line Layout */
.hsm-next-shift-widget {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.hsm-next-shift-content {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
}

.hsm-shift-single-line {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.hsm-status-badge {
    background: #ffd700;
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.hsm-current-shift .hsm-status-badge {
    background: #dc3232;
    color: white;
    animation: hsm-pulse 2s infinite;
}

.hsm-shift-highlight {
    font-weight: bold;
    color: #ffd700;
}

.hsm-shift-department {
    font-style: italic;
    opacity: 0.9;
}

.hsm-shift-datetime {
    opacity: 0.9;
}

.hsm-separator {
    opacity: 0.6;
    font-weight: normal;
}

.hsm-no-shift {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

/* Marquee Effect */
.hsm-next-shift-marquee {
    display: inline-block;
    padding-left: 100%;
    animation: hsm-marquee 20s linear infinite;
    white-space: nowrap;
}

@keyframes hsm-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Pause on hover */
.hsm-next-shift-content:hover .hsm-next-shift-marquee {
    animation-play-state: paused;
}

@keyframes hsm-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .hsm-next-shift-content {
        font-size: 14px;
    }
    
    .hsm-status-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .hsm-shift-single-line {
        gap: 8px;
    }
    
    .hsm-next-shift-marquee {
        animation-duration: 25s;
    }
}