/* Schedules CSS - Styles for schedule management */

/* Tabs */
.tabs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: var(--neutral-100);
    border-bottom: 2px solid var(--neutral-200);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-btn:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
}

.tab-btn.active {
    color: var(--primary);
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tabs-content {
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Day Schedules */
.day-schedule-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.day-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.day-schedule-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.schedule-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-closed {
    background: var(--danger);
    color: white;
}

.status-open {
    background: var(--success);
    color: white;
}

/* Period Table */
.period-table {
    width: 100%;
    margin-top: 10px;
}

.period-table table {
    width: 100%;
    border-collapse: collapse;
}

.period-table th,
.period-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--neutral-200);
}

.period-table th {
    background: var(--neutral-200);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--neutral-700);
}

.period-table tr:last-child td {
    border-bottom: none;
}

.period-actions {
    display: flex;
    gap: 5px;
}

/* Week Schedules */
.week-schedule-card {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.week-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.week-schedule-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.week-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.week-day-item {
    padding: 10px;
    background: var(--neutral-100);
    border-radius: 4px;
}

.week-day-name {
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 5px;
}

.week-day-schedule {
    font-size: 0.9rem;
    color: var(--neutral-600);
}

/* Add/Edit Forms */
.schedule-form {
    background: var(--neutral-50);
    border: 1px dashed var(--neutral-300);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.schedule-form h4 {
    margin-bottom: 15px;
    color: var(--neutral-800);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Temperature Input */
.temp-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.temp-input-group input {
    width: 80px;
}

.temp-input-group span {
    color: var(--neutral-600);
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Loading State */
.schedules-loading {
    text-align: center;
    padding: 40px;
    color: var(--neutral-600);
}

.schedules-loading .loading {
    margin: 0 auto 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--neutral-600);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 10px;
}

.empty-state-title {
    font-size: 1.2rem;
    color: var(--neutral-700);
    margin-bottom: 5px;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* Schedule List Items */
.schedule-list {
    background: white;
}

.schedule-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item:hover {
    background: var(--neutral-100);
}

.schedule-item.selected {
    background: var(--primary);
    color: white;
}

.schedule-item.selected .badge {
    background: rgba(255,255,255,0.3);
}

.schedule-name {
    font-size: 0.9rem;
}

/* New Schedule Form */
.new-schedule-form {
    background: var(--neutral-100);
}

.new-schedule-form .form-label {
    margin-bottom: 5px;
    display: block;
}

/* Badge styles */
.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--neutral-500);
    color: white;
}

.badge-secondary {
    background: var(--neutral-400);
}

/* Small button */
.btn-xs {
    padding: 2px 6px;
    font-size: 0.75rem;
}

/* Period table compact styles */
#periods-table input[type="time"] {
    width: 70px !important;
    padding: 2px 4px;
}

#periods-table input[type="number"] {
    width: 55px !important;
    padding: 2px 4px;
    -moz-appearance: textfield;
}

#periods-table input[type="number"]::-webkit-outer-spin-button,
#periods-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#periods-table th,
#periods-table td {
    padding: 4px 6px;
    vertical-align: middle;
}

/* iPad and tablet responsive styles */
@media (max-width: 1024px) {
    .period-table {
        overflow-x: auto;
    }

    .period-table table {
        min-width: 100%;
    }

    #periods-table input[type="time"] {
        width: 90px !important;
    }

    #periods-table input[type="number"] {
        width: 60px !important;
    }

    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: 100px;
        padding: 12px 10px;
        font-size: 13px;
    }

    .week-days-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .ohc-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ohc-header select {
        flex: 1 1 200px;
    }
}
