/* css/main.css */

/* ========== Подключение шрифта ========== */
@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');

/* ========== CSS Переменные (основные) ========== */
:root {
    --font-family: 'Play', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== Приложение ========== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: var(--color-white);
}

#app.ready {
    opacity: 1;
}

/* ========== Хедер ========== */
#app-header {
    height: var(--header-height);
    background: var(--color-dynamic-red);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

#header-title {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.1;
}

#header-week-range {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.3px;
    text-align: center;
    white-space: nowrap;
}

#btn-prev-week,
#btn-next-week {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-white);
    transition: background 0.15s ease;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

#btn-prev-week:hover,
#btn-next-week:hover {
    background: rgba(255, 255, 255, 0.15);
}

#btn-prev-week:active,
#btn-next-week:active {
    background: rgba(255, 255, 255, 0.25);
}

#btn-prev-week svg,
#btn-next-week svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ========== Основной контент ========== */
#app-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--color-white);
}

/* ========== Представления (вкладки) ========== */
.view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    flex-direction: column;
    background: var(--color-white);
    -webkit-overflow-scrolling: touch;
}

.view.active {
    display: flex;
}

/* ========== Общие кнопки ========== */
.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-white);
    transition: background 0.15s ease;
    cursor: pointer;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-icon:active {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== Формы (общие) ========== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-label {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 15px;
    background: var(--color-bg);
    color: var(--color-dark-gray);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--color-ocean-blue);
    box-shadow: 0 0 0 3px rgba(58, 119, 157, 0.1);
    background: var(--color-white);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.4;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #BBB;
}

/* ========== Кнопки действий ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--color-dynamic-red);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #C0040E;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-dark-gray);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-light-gray);
}

.btn-secondary:active {
    transform: scale(0.97);
}

/* ========== Строка с датами (в виде дня) ========== */
#day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-white);
    border-bottom: 1px solid #E0E0E0;
}

#day-header .btn-icon {
    color: var(--color-dark-gray);
    width: 36px;
    height: 36px;
}

#day-header .btn-icon:hover {
    background: #F0F0F0;
}

#day-label {
    font-family: 'Play', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-dark-gray);
}

/* ========== Анимации ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ========== Утилиты ========== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== Скроллбар ========== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #CCC;
}
