:root {
  --red: #ff0000;
  --medium-red: #cc2a2a;
  --dark-red: #b30000;
  --light-red: #ffd8db;
  --orange: #ff790a;
  --light-orange: #fbdcc2;
  --yellow: #faca2b;
  --light-yellow: #ffe58f;
  --green: #28a745;
  --medium-green: #18d140;
  --light-green: #d4f8dc;
  --blue: #1f3091;
  --light-blue: #c7d2fe;
  --purple: #671f91;
  --purplish-gray: #80668e;
  --gray: #555555;
  --medium-gray: #aaa;
  --light-gray: #dddddd;
}

.small-screen-only-block {
    display: none;
}
.small-screen-only-inline {
    display: none;
}
.large-screen-only-block {
    display: block;
}
.large-screen-only-inline {
    display: inline;
}


.button {
    color: var(--blue);
    border: var(--blue);
    padding: 8px 16px;
    border-radius: 4px;
}

/* Calendar Styles */
.shift-scheduler-calendar {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.signup-window-notice {
    background-color: #e7f5ff;
    border-left: 4px solid #4dabf7;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.shift-login-notice {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
}

.shift-calendar-container {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow: hidden;
}

.calendar-info {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.shift-week {
    border-top: 1px solid #cccccc;
}

.shift-week h3 {
    background-color: #f8f9fa;
    padding: 10px 15px;
    margin: 0;
    border-bottom: 1px solid #dedede;
    font-size: 18px;
}

/* Days container - use CSS Grid for better layout control */
.shift-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* Create 7 equal columns */
    width: 100%;
}

.shift-day {
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    min-height: 200px;
    position: relative;
    background-color: white;
}

.shift-day:last-child {
    border-right: none;
}

.shift-day.weekend {
    background-color: #f8f9fa;
    opacity: 1; /* Make sure weekend days are fully visible */
}

.day-header {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.day-name {
    display: block;
    color: #6c757d;
    font-size: 0.9em;
    font-weight: bold;
}

.full-day-name {  /* making this accessible to JS for renderingmodals */
    display: none; 
}

.day-date {
    display: block;
    /*color: #6c757d;*/
    font-size: 0.9em;
    font-weight: bold
}

.day-shifts {
    padding: 10px;
}

.shift-item {
    margin-bottom: 15px;
    /*padding: 10px;*/
}

.shift-info {
    margin-bottom: 10px;
}

.shift-type {
    display: block;
    font-weight: bold;
    color: #333333;
    font-size: 18px;
    margin-bottom: 5px;
}

.shift-time {
    display: block;
    font-size: 14px;
    color: #555555;
    margin-bottom: 5px;
}

.shift-availability {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #666666;
    margin-bottom: 5px;
}

.shift-request-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s;
}

.shift-request-btn:hover {
    background-color: #0069d9;
}

.shift-request-btn:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
}

.shift-request-btn.shift-pending {
    background-color: var(--yellow);
    color: #fff;
}

.shift-request-btn.shift-approved {
    background-color: var(--medium-green);
    color: #fff;
}

.shift-request-btn.shift-denied {
    background-color: var(--purple);
    color: #fff;
}

.shift-request-btn.shift-completed, .shift-request-btn.shift-completed_tardy {
    background-color: var(--green);
}


.shift-request-btn.shift-full {
    background-color: #6c757d;
}

.shift-request-btn.shift-too-soon,
.shift-request-btn.shift-too-far {
    background-color: #6c757d;
    opacity: 0.7;
    cursor: not-allowed;
}

.shift-request-btn.shift-too-soon:hover,
.shift-request-btn.shift-too-far:hover {
    background-color: #6c757d;
}

.no-shifts {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Unavailable shift styles */
.shift-unavailable-item {
    opacity: 0.8;
}

.shift-request-btn.shift-unavailable {
    background-color: var(--gray);
    opacity: 0.7;
    cursor: not-allowed;
}

.shift-request-btn.shift-unavailable:hover {
    background-color: var(--gray);
}

.shift-limit-warning {
    background-color: #f8d7da;
    border-left: 4px solid var(--medium-red);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.shift-limit-warning p {
    margin-bottom: 10px;
}

.shift-limit-warning ul {
    margin: 0 0 15px 20px;
}

.shift-limit-warning .button {
    background-color: var(--medium-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
}

.shift-limit-warning .button:hover {
    background-color: #c82333;
}

.shift-request-btn.shift-at-limit {
    background-color: #6c757d;
}

/* Modal Styles */
.shift-request-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.confirm-request {
    background-color: #007bff;
    color: #fff;
}

.cancel-request {
    background-color: #6c757d;
    color: #fff;
}

/* My Shifts Page Styles */
.my-shifts-container {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.no-shifts-message {
    background-color: #f8f9fa;
    padding: 30px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shifts-tabs {
    display: flex;
    font-size: 0.9em;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    padding: 10px 20px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #6c757d;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.shifts-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.shifts-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.shifts-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: normal;
}

.status-pending {
    background-color: var(--light-yellow);
    color: #333;
    border: 2px solid var(--light-yellow);
}

.status-approved {
    background-color: var(--light-green);
    color: #333;
    border: 2px solid var(--light-green);
}

.status-denied {
    background-color: var(--light-gray);
    color: #333;
}

.status-cancelled_covered {
    background-color: var(--purplish-gray);
    border: 2px solid var(--purplish-gray);
    opacity: 0.7;
    color: #000;
}

.status-cancelled_absent, .status-cancelled_no_show {
    background-color: var(--medium-red);
    color: #efefef;
    border: 2px solid var(--medium-red);
}

.status-completed {
    background-color: var(--green);
    color: #efefef;
    border: 2px solid var(--green);
}

.status-completed_tardy {
    background-color: var(--light-red);
    color: #333;
    border: 2px solid var(--light-red);
}

.shift-request-btn.shift-cancelled_covered {
    background-color: var(--purplish-gray);
    opacity: 0.7;
    cursor: not-allowed;
}

.shift-request-btn.shift-cancelled_absent {
    background-color: var(--red);
    opacity: 1.0;
    cursor: not-allowed;
}

.shift-request-btn.shift-cancelled_no_show {
    background-color: var(--red);
    opacity: 1.0;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .shift-days {
        grid-template-columns: repeat(7, minmax(110px, 1fr));
    }
    
    .shift-item {
        padding: 8px;
    }
    
    .shift-type {
        font-size: 15px;
    }
    
    .shift-time, .shift-availability {
        font-size: 13px;
    }
}

/* Small tablet / large phone layout - show 4 days per row */
@media (max-width: 768px) {
    .shift-days {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* Show 4 days per row */
        width: 100%;
    }
    
    /* Reapply borders since the layout changes */
    .shift-day {
        border-right: 1px solid #e9ecef;
        border-bottom: 1px solid #e9ecef;
    }
    
    .shift-day:nth-child(4n) {
        border-right: none;
    }
    
    /* Increase font size for shift time and availability on mobile */
    .shift-time {
        font-size: 14px !important;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .shift-availability {
        font-size: 14px !important;
        line-height: 1.4;
        margin-bottom: 8px;
        font-weight: 500;
    }
    
    /* Make shift type more prominent */
    .shift-type {
        font-size: 16px !important;
        margin-bottom: 8px;
    }
    
    /* Improve spacing in shift items */
    .shift-item {
        padding: 12px;
        margin-bottom: 18px;
    }
    
    /* Make buttons more tappable on mobile */
    .shift-request-btn {
        padding: 10px 0;
        font-size: 15px;
        min-height: 44px;
    }
    
    .shifts-table {
        display: block;
        overflow-x: auto;
    }
}

/* Mobile layout - show days in a list (1 day per row) */
@media (max-width: 576px) {
    .large-screen-only-block, .large-screen-only-inline {
        display: none;
    }
    .small-screen-only-block {
        display: block;
    }
    .small-screen-only-inline {
        display: inline;
    }

    .shift-days {
        display: block; /* Change to block layout */
        width: 100%;
    }
    
    .shift-day {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 15px;
    }
    
    /* Improved day header formatting for mobile */
    .day-header {
        display: flex;
        align-items: left;
        justify-content: space-between;
        padding: 12px 15px;
    }
    
    .day-name {
        font-size: 18px;
        font-weight: bold;
    }
    
    .day-date {
        font-size: 16px;
    }
    
    /* Enhance shifts for mobile */
    .day-shifts {
        padding: 12px 15px;
    }
    
    .shift-item {
        padding: 15px;
        margin-bottom: 12px;
        border-left: 4px solid #e9ecef;
    }
    
    /* Target all key text elements and force larger size */
    .shift-time {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
        color: #000 !important; /* Darker color for better contrast */
    }
    
    .shift-availability {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 10px !important;
        color: #000 !important; /* Darker color for better contrast */
    }
    
    .shift-type {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
        font-weight: bold !important;
    }
    
    /* Make buttons much more tappable */
    .shift-request-btn {
        padding: 15px 0 !important;
        font-size: 16px !important;
        min-height: 50px !important;
        margin-top: 5px !important;
    }
    
    /* Improve modal for mobile devices */
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px 15px;
    }
    
    .shift-details {
        font-size: 16px;
    }
    
    .modal-buttons button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 48px; /* Increase tap target */
    }
    
    /* For iOS Safari specific issues */
    html {
        -webkit-text-size-adjust: 100% !important;
    }
}

/* iPhone-specific styles */
@media only screen and (max-device-width: 480px), 
        only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3),
        only screen and (min-device-width: 414px) and (max-device-width: 896px) and (-webkit-min-device-pixel-ratio: 2) {
    
    .shift-time, .shift-availability {
        font-size: 18px !important; /* Even larger for iPhone */
        line-height: 1.4 !important;
    }
    
    .shift-type {
        font-size: 20px !important;
    }
    
    /* Increase all clickable elements to iOS minimum 44px */
    .shift-request-btn {
        height: auto !important;
        min-height: 50px !important;
    }
}

/* Add viewport meta tag for proper mobile rendering */
@-ms-viewport{
    width: device-width;
}