/* ============================================
   MEDITATION BOOKING SYSTEM - PUBLIC STYLES
   Version: 1.1.0
   Author: Villi Voll
   ============================================ */

/* ============================================
   1. BASE CONTAINER & RESET
   ============================================ */

.mbs-calendar-container {
    max-width: 100% !important;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

.mbs-calendar-container * {
    box-sizing: border-box;
}

/* ============================================
   2. GRID LAYOUT SYSTEM
   ============================================ */

.mbs-calendar-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 500px !important;
    grid-template-rows: auto !important;
    gap: 25px !important;
    align-items: start !important;
    width: 100% !important;
    position: relative;
}

.mbs-calendar-wrapper.has-booking {
    grid-template-columns: 1fr 500px 600px !important;
}

.mbs-calendar-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.mbs-sessions-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 16px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.mbs-sessions-panel.empty {
    opacity: 0.5;
    pointer-events: none;
}

.mbs-booking-panel {
    grid-column: 3 !important;
    grid-row: 1 !important;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 16px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    display: none;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 20;
}

.mbs-booking-panel.active {
    display: flex !important;
    opacity: 1;
    transform: translateX(0);
}

.mbs-calendar-wrapper.has-booking .mbs-calendar-main {
    overflow: hidden;
}

.mbs-calendar-wrapper.has-booking .mbs-calendar-main::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 25px;
    background: white;
    pointer-events: none;
    z-index: 5;
    box-shadow: -5px 0 10px rgba(0,0,0,0.05);
}

/* ============================================
   3. CALENDAR HEADER
   ============================================ */

.mbs-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 8px 24px rgba(255, 212, 168, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.mbs-calendar-header::before,
.mbs-calendar-header::after {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

.mbs-current-month {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 100;
    flex: 1;
    text-align: center;
}

.mbs-nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer !important;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1000 !important;
    position: relative;
    pointer-events: auto !important;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: bold;
}

.mbs-nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.mbs-nav-btn:active {
    transform: scale(0.95);
}

/* ============================================
   4. CALENDAR GRID & DAYS
   ============================================ */

.mbs-calendar-grid {
    background: white;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 0 0 16px 16px;
}

.mbs-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.mbs-weekday {
    text-align: center;
    font-weight: 700;
    color: #666;
    padding: 8px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.mbs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.mbs-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    position: relative;
    font-size: 15px;
    background: #f8f9fa;
    min-height: 50px;
}

.mbs-day.empty {
    cursor: default;
    opacity: 0;
    background: transparent;
}

.mbs-day.available {
    background: linear-gradient(135deg, #fff5e8 0%, #ffe8cc 100%);
    border-color: #ffe0c1;
    color: #8b6f47;
    box-shadow: 0 2px 8px rgba(255, 224, 193, 0.15);
}

.mbs-day.available::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ffe0c1;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 224, 193, 0.6);
}

.mbs-day.available:hover {
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%);
    color: #6b4f2f;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 224, 193, 0.5);
}

.mbs-day.today {
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.mbs-day.selected {
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%) !important;
    color: #6b4f2f !important;
    border-color: #ffb366;
    box-shadow: 0 8px 20px rgba(255, 224, 193, 0.5);
    transform: scale(1.05);
}

/* ============================================
   5. SESSIONS PANEL
   ============================================ */

.mbs-panel-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%);
    color: #6b4f2f;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mbs-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #6b4f2f;
}

.mbs-panel-instruction {
    padding: 30px 20px;
    text-align: center;
    color: #999;
}

.mbs-panel-instruction-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mbs-sessions-list {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.mbs-sessions-list::-webkit-scrollbar {
    width: 6px;
}

.mbs-sessions-list::-webkit-scrollbar-thumb {
    background: #ffe0c1;
    border-radius: 10px;
}

/* ============================================
   6. SESSION ITEMS
   ============================================ */

.mbs-session-item {
    background: white;
    padding: 18px 22px;
    margin-bottom: 12px;
    border-radius: 12px;
    border-left: 4px solid #FFF2F2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mbs-session-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-left-color: #FFD5D5;
}

.mbs-session-title {
    font-size: 18px;
    font-weight: 700;
    color: #545454;
    margin: 0 0 12px 0;
}

.mbs-session-time-duration {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #545454;
}

.mbs-session-time {
    font-size: 15px;
    font-weight: 600;
    color: #545454;
}

.mbs-session-time-duration .mbs-session-spots {
    font-size: 13px;
    color: #545454;
    font-weight: 600;
}

.mbs-session-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 10px 0;
}

.mbs-session-location {
    font-size: 13px;
    color: #545454;
    margin: 8px 0;
    font-weight: 600;
}

.mbs-session-price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.mbs-session-price {
    font-size: 18px;
    font-weight: 700;
    color: #545454;
    margin: 0;
}

.mbs-session-action {
    margin: 0;
}

.mbs-btn-select {
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%);
    color: #6b4f2f;
    border: 2px solid #ffb366;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 224, 193, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mbs-btn-select:hover {
    background: linear-gradient(135deg, #ffd4a8 0%, #ffb366 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 224, 193, 0.4);
}

/* ============================================
   7. BOOKING PANEL
   ============================================ */

.mbs-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #ffe0c1 0%, #ffd4a8 100%);
    color: #6b4f2f;
    flex-shrink: 0;
}

.mbs-booking-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #6b4f2f;
}

.mbs-close-booking {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #6b4f2f;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.mbs-close-booking:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.mbs-booking-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.mbs-booking-body::-webkit-scrollbar {
    width: 6px;
}

.mbs-booking-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mbs-booking-body::-webkit-scrollbar-thumb {
    background: #ffe0c1;
    border-radius: 10px;
}

/* ============================================
   8. FORM ELEMENTS
   ============================================ */

.mbs-session-summary {
    background: #FFF2F2C2;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 6px solid #FFD5D5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.mbs-session-summary h3 {
    margin: 0 0 18px;
    color: #545454;
    font-size: 22px;
    font-weight: 800;
}

.mbs-session-summary p {
    margin: 8px 0;
    font-size: 14px;
    color: #545454;
}

.mbs-form-group {
    margin-bottom: 20px;
}

.mbs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.mbs-form-group input[type="text"],
.mbs-form-group input[type="email"],
.mbs-form-group input[type="tel"],
.mbs-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.mbs-form-group input:focus,
.mbs-form-group textarea:focus {
    outline: none;
    border-color: #ffe0c1;
    box-shadow: 0 0 0 4px rgba(255, 224, 193, 0.1);
    transform: translateY(-1px);
}

.mbs-form-group input::placeholder,
.mbs-form-group textarea::placeholder {
    color: #999;
}

.mbs-discount-input {
    display: flex;
    gap: 10px;
}

.mbs-discount-input input {
    flex: 1;
}

.mbs-discount-input input:read-only {
    background: #f0f0f0;
    cursor: not-allowed;
}

.mbs-checkbox {
    display: flex;
    align-items: start;
    gap: 14px;
    cursor: pointer;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.mbs-checkbox:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #ffe0c1;
    box-shadow: 0 4px 12px rgba(255, 224, 193, 0.15);
}

.mbs-checkbox input {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.mbs-checkbox span {
    font-size: 14px;
    color: #333;
}

.mbs-payment-info {
    background: #FFF2F2C2;
    border: 2px solid #FFD5D5;
    border-left: 6px solid #FFD5D5;
    padding: 18px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #545454;
    box-shadow: 0 2px 8px rgba(255, 213, 213, 0.2);
}

/* ============================================
   9. BUTTONS & ACTIONS
   ============================================ */

.mbs-btn-primary {
    background: linear-gradient(135deg, #FFF2F2 0%, #FFE5E5 100%);
    color: #545454;
    border: 2px solid #FFD5D5;
    padding: 18px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 6px 16px rgba(255, 213, 213, 0.3);
    text-transform: none;
}

.mbs-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFE5E5 0%, #FFD5D5 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 213, 213, 0.4);
}

.mbs-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.mbs-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #ccc;
}

.mbs-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   10. MESSAGES & NOTIFICATIONS
   ============================================ */

.mbs-message {
    padding: 16px 20px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mbs-message::before {
    font-size: 20px;
}

.mbs-message.success {
    background: linear-gradient(135deg, #fff5e8 0%, #ffe8cc 100%);
    border: 2px solid #ffe0c1;
    border-left: 5px solid #ffe0c1;
    color: #8b6f47;
}

.mbs-message.success::before {
    content: "✓";
    font-weight: bold;
    color: #ffe0c1;
}

.mbs-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3232;
    border-left: 5px solid #dc3232;
    color: #721c24;
}

.mbs-message.error::before {
    content: "✗";
    font-weight: bold;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   11. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1600px) {
    .mbs-calendar-wrapper.has-booking {
        grid-template-columns: 1fr 480px 580px !important;
    }
}

@media (max-width: 1400px) {
    .mbs-calendar-wrapper {
        grid-template-columns: 1fr 450px !important;
    }
    
    .mbs-calendar-wrapper.has-booking {
        grid-template-columns: 1fr 420px 520px !important;
    }
}

@media (max-width: 1200px) {
    .mbs-calendar-wrapper,
    .mbs-calendar-wrapper.has-booking {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .mbs-calendar-main,
    .mbs-sessions-panel,
    .mbs-booking-panel {
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        top: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

@media (max-width: 968px) {
    .mbs-calendar-container {
        padding: 10px;
    }
    
    .mbs-form-group input,
    .mbs-form-group textarea {
        font-size: 16px;
    }
    
    .mbs-discount-input {
        flex-direction: column;
    }
    
    .mbs-discount-input input {
        width: 100%;
    }
    
    .mbs-btn-secondary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .mbs-calendar-container {
        padding: 5px;
    }
    
    .mbs-calendar-header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mbs-current-month {
        font-size: 18px;
        width: 100%;
        text-align: center;
        order: 1;
    }
    
    .mbs-prev-month {
        order: 2;
    }
    
    .mbs-next-month {
        order: 3;
    }
    
    .mbs-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .mbs-calendar-grid {
        padding: 15px;
    }
    
    .mbs-weekday {
        font-size: 10px;
        padding: 5px;
    }
    
    .mbs-day {
        font-size: 13px;
        min-height: 36px;
        padding: 5px;
    }
    
    .mbs-day.available::after {
        width: 4px;
        height: 4px;
        bottom: 4px;
    }
    
    .mbs-sessions-panel {
        margin-top: 15px;
    }
    
    .mbs-panel-header {
        padding: 15px 20px;
    }
    
    .mbs-panel-header h3 {
        font-size: 16px;
    }
    
    .mbs-sessions-list {
        padding: 10px;
    }
    
    .mbs-session-item {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .mbs-session-title {
        font-size: 14px;
    }
    
    .mbs-session-time,
    .mbs-session-duration,
    .mbs-session-desc {
        font-size: 12px;
    }
    
    .mbs-session-price {
        font-size: 16px;
    }
    
    .mbs-btn-select {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .mbs-booking-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        z-index: 99999 !important;
    }
    
    .mbs-booking-panel.active {
        display: flex !important;
    }
    
    .mbs-booking-header {
        padding: 15px 20px;
        flex-shrink: 0;
    }
    
    .mbs-booking-header h3 {
        font-size: 16px;
    }
    
    .mbs-close-booking {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    .mbs-booking-body {
        padding: 15px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mbs-session-summary {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .mbs-session-summary h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .mbs-session-summary p {
        font-size: 13px;
        margin: 5px 0;
    }
    
    .mbs-form-group {
        margin-bottom: 15px;
    }
    
    .mbs-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .mbs-form-group input,
    .mbs-form-group textarea {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .mbs-checkbox {
        padding: 14px;
        gap: 10px;
    }
    
    .mbs-checkbox input {
        width: 18px;
        height: 18px;
    }
    
    .mbs-checkbox span {
        font-size: 13px;
    }
    
    .mbs-payment-info {
        padding: 14px;
        font-size: 13px;
        margin: 15px 0;
    }
    
    .mbs-btn-primary {
        padding: 14px;
        font-size: 15px;
    }
    
    .mbs-message {
        padding: 12px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .mbs-calendar-header {
        padding: 10px;
    }
    
    .mbs-current-month {
        font-size: 16px;
    }
    
    .mbs-nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .mbs-calendar-grid {
        padding: 10px;
    }
    
    .mbs-calendar-days {
        gap: 4px;
    }
    
    .mbs-day {
        font-size: 12px;
        min-height: 32px;
        border-radius: 8px;
    }
    
    .mbs-session-item {
        padding: 12px;
    }
    
    .mbs-session-title {
        font-size: 13px;
    }
    
    .mbs-btn-select {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .mbs-calendar-container {
        padding: 2px;
    }
    
    .mbs-calendar-grid {
        padding: 8px;
    }
    
    .mbs-day {
        font-size: 11px;
        min-height: 28px;
    }
    
    .mbs-weekday {
        font-size: 9px;
        padding: 3px;
    }
}

@media (max-width: 968px) and (orientation: landscape) {
    .mbs-booking-panel {
        max-height: 100vh !important;
    }
    
    .mbs-booking-body {
        max-height: calc(100vh - 60px) !important;
    }
}

@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .mbs-booking-panel {
            height: -webkit-fill-available !important;
            min-height: 100vh !important;
        }
    }
}