/* ============================================
   アラームSNS - カスタムCSS
   Materialize CSSを補完する追加スタイル
   ============================================ */

/* 全体の背景色（SNSっぽい柔らかい印象） */
body {
    background: #f9fbfd;
    min-height: 100vh;
}

/* ロゴスタイル */
.avis-logo {
    font-family: 'Montserrat', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: .1em;
}

/* ハンバーガーメニュー（サイドナビトリガー） */
.sidenav-trigger {
    display: none !important;
}

/* サイドナビゲーション */
.sidenav {
    width: 280px;
}

.sidenav .user-view {
    padding: 32px 32px 24px;
}

.sidenav li > a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    height: 48px;
    line-height: 48px;
    font-size: 15px;
    transition: background-color 0.2s ease;
}

.sidenav li > a:hover {
    background-color: rgba(33, 150, 243, 0.08);
}

.sidenav li > a i.material-icons {
    margin: 0;
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 24px;
}

.sidenav .divider {
    margin: 8px 0;
}

/* 無効化されたリンク（次期搭載予定） */
.nav-link-disabled,
.sidenav li > a.disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
    position: relative;
}

nav .nav-link-disabled {
    color: #9E9E9E !important;
}

.sidenav li > a.disabled {
    color: #9E9E9E !important;
}

.sidenav li > a.disabled i.material-icons {
    color: #9E9E9E !important;
}

/* ツールチップ */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.tooltip-wrapper .tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: #424242;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 400;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip-wrapper .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #424242 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* モバイルとタブレットでハンバーガーメニューを表示 */
@media only screen and (max-width: 992px) {
    .sidenav-trigger {
        display: block !important;
    }
}

/* カードのスタイル（角丸と軽めの影） */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(120, 180, 255, 0.07), 
                0 1.5px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.card.hoverable:hover {
    box-shadow: 0 4px 12px rgba(120, 180, 255, 0.12), 
                0 2px 6px rgba(0, 0, 0, 0.08);
}

/* アラーム作成フォームカードの背景色 */
.alarm-form-card {
    background: #fffbe9;
}

/* Googleカレンダー風のフォームスタイル */
.alarm-form-card .input-field input[type="text"]:focus,
.alarm-form-card .input-field input[type="date"]:focus,
.alarm-form-card .input-field input[type="time"]:focus,
.alarm-form-card .input-field textarea:focus {
    border-bottom: 2px solid #2196F3 !important;
    box-shadow: 0 1px 0 0 #2196F3 !important;
}

.alarm-form-card .input-field input[type="text"]:focus + label,
.alarm-form-card .input-field input[type="date"]:focus + label,
.alarm-form-card .input-field input[type="time"]:focus + label,
.alarm-form-card .input-field textarea:focus + label {
    color: #2196F3 !important;
}

.alarm-form-card .input-field label {
    font-size: 0.9rem;
    color: #757575;
}

.alarm-form-card .input-field .prefix {
    color: #757575;
    font-size: 20px;
    width: 3rem;
}

.alarm-form-card .input-field .prefix ~ input,
.alarm-form-card .input-field .prefix ~ textarea {
    margin-left: 3rem;
    width: calc(100% - 3rem);
}

/* ============================================
   Material Design風の日付・時間ピッカー
   Material Design 3.0準拠
   ============================================ */

.material-datetime-section {
    margin-top: 24px;
    width: 100%;
}

.material-datetime-section .row {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.material-datetime-section .row .col {
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
    width: 100%;
    float: none;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 12px;
}

.material-datetime-section .row .col:last-child {
    margin-bottom: 0;
}

/* Material Designカード */
.material-picker-card {
    position: relative;
    width: 100%;
}

/* Material Designトリガー（クリック可能エリア） */
.material-picker-trigger {
    background: #ffffff;
    border-radius: 4px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 
                0 1px 2px rgba(0, 0, 0, 0.06);
    user-select: none;
    -webkit-user-select: none;
}

.material-picker-trigger:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 
                0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.material-picker-trigger:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 
                0 1px 2px rgba(0, 0, 0, 0.24);
    transform: translateY(0);
}

/* フォーカス状態 */
.material-picker-card.focused .material-picker-trigger {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15), 
                0 2px 4px rgba(0, 0, 0, 0.1);
    outline: 2px solid #2196F3;
    outline-offset: -2px;
}

/* アイコン */
.material-picker-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 150, 243, 0.08);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.material-picker-icon i {
    color: #2196F3;
    font-size: 24px;
    transition: color 0.3s ease;
}

.material-picker-trigger:hover .material-picker-icon {
    background: rgba(33, 150, 243, 0.12);
    transform: scale(1.05);
}

.material-picker-card.focused .material-picker-icon {
    background: rgba(33, 150, 243, 0.16);
}

/* コンテンツエリア */
.material-picker-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* ラベル */
.material-picker-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: 0.4px;
    line-height: 1.2;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.material-picker-trigger:hover .material-picker-label {
    color: rgba(0, 0, 0, 0.87);
}

.material-picker-card.focused .material-picker-label {
    color: #2196F3;
}

/* 値ラッパー */
.material-picker-value-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    min-width: 0;
}

/* 値表示 */
.material-picker-value {
    font-size: 16px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 100%;
}

.material-picker-card.has-value .material-picker-value {
    color: #2196F3;
    font-weight: 500;
}

/* ヒントテキスト */
.material-picker-hint {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.38);
    line-height: 1.4;
    transition: opacity 0.3s ease;
}

.material-picker-card.has-value .material-picker-hint {
    display: none;
}

/* 矢印アイコン */
.material-picker-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.material-picker-arrow i {
    color: rgba(0, 0, 0, 0.54);
    font-size: 20px;
    transition: all 0.3s ease;
}

.material-picker-trigger:hover .material-picker-arrow i {
    color: #2196F3;
    transform: translateY(2px);
}

.material-picker-card.focused .material-picker-arrow i {
    color: #2196F3;
    transform: rotate(180deg);
}

/* リップルエフェクト */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
    opacity: 0;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 入力フィールド（非表示） */
.material-picker-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    border: none;
    padding: 0;
    margin: 0;
}

/* 値が選択されている状態 */
.material-picker-card.has-value .material-picker-trigger {
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.16), 
                0 1px 3px rgba(0, 0, 0, 0.08);
}

.material-picker-card.has-value .material-picker-icon {
    background: rgba(33, 150, 243, 0.12);
}

/* ============================================
   Material Design風カスタムカレンダー
   ============================================ */

.material-date-picker-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15),
                0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    padding: 20px;
    min-width: 320px;
    max-width: 90vw;
    width: 100%;
    max-width: 400px;
    animation: materialCalendarFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    overflow: hidden;
}

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

.material-date-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: materialOverlayFadeIn 0.2s ease-out;
}

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

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

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

.material-date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.material-date-picker-title {
    font-size: 20px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
    margin: 0;
}

.material-date-picker-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    color: rgba(0, 0, 0, 0.54);
}

.material-date-picker-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.material-date-picker-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.material-date-picker-nav-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    color: rgba(0, 0, 0, 0.54);
    border: none;
    background: transparent;
}

.material-date-picker-nav-button:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.material-date-picker-nav-button:active {
    background-color: rgba(0, 0, 0, 0.12);
}

.material-date-picker-month-year {
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
    text-align: center;
    flex: 1;
}

.material-date-picker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.material-date-picker-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.54);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.material-date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 0 4px;
}

.material-date-picker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 40px;
    min-width: 40px;
}

.material-date-picker-day:hover {
    background-color: rgba(33, 150, 243, 0.08);
}

.material-date-picker-day.other-month {
    color: rgba(0, 0, 0, 0.26);
}

.material-date-picker-day.today {
    font-weight: 500;
    color: #2196F3;
}

.material-date-picker-day.today::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #2196F3;
    box-sizing: border-box;
}

.material-date-picker-day.selected {
    background-color: #2196F3;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.material-date-picker-day.selected.today::before {
    border-color: #ffffff;
}

.material-date-picker-day:active {
    transform: scale(0.95);
}

/* モーダル内でカレンダーが表示される場合の調整 */
.modal .material-date-picker-popup {
    max-width: calc(100% - 32px);
    width: auto;
    min-width: 280px;
    padding: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
}

.modal .material-date-picker-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.modal .material-date-picker-nav {
    margin-bottom: 10px;
    padding: 0 2px;
}

.modal .material-date-picker-weekdays {
    margin-bottom: 8px;
    padding: 0 2px;
}

.modal .material-date-picker-days {
    gap: 4px;
    padding: 0 2px;
}

.modal .material-date-picker-day {
    min-height: 36px;
    min-width: 36px;
    font-size: 13px;
}

.modal .material-date-picker-weekday {
    font-size: 11px;
    padding: 6px 0;
}

/* モバイル対応 */
@media (max-width: 600px) {
    .material-date-picker-popup {
        min-width: 90vw;
        max-width: 90vw;
        padding: 16px 12px;
        border-radius: 12px;
    }

    .material-date-picker-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .material-date-picker-nav {
        margin-bottom: 12px;
    }

    .material-date-picker-weekdays {
        margin-bottom: 10px;
        padding: 0 2px;
    }

    .material-date-picker-days {
        gap: 6px;
        padding: 0 2px;
    }

    .material-date-picker-day {
        min-height: 44px;
        min-width: 44px;
        font-size: 15px;
    }

    .material-date-picker-weekday {
        font-size: 11px;
        padding: 6px 0;
    }

    /* モーダル内でカレンダーが表示される場合（モバイル） */
    .modal .material-date-picker-popup {
        max-width: calc(100% - 24px);
        padding: 12px;
    }

    .modal .material-date-picker-day {
        min-height: 32px;
        min-width: 32px;
        font-size: 12px;
    }
}

/* ============================================
   時間プルダウン（1時間ごと、15分ごと）
   ============================================ */

.time-picker-dropdown {
    width: 100%;
    margin-top: 0;
}

.time-picker-dropdown .time-picker-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: 0.4px;
    line-height: 1.2;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.time-select-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.time-select-group {
    flex: 1;
    position: relative;
}

.time-select {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    box-sizing: border-box;
}

.time-select:hover {
    border-color: #2196F3;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.12);
}

.time-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.time-select option {
    padding: 8px;
    font-size: 16px;
}

.time-separator-text {
    font-size: 20px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.54);
    line-height: 48px;
    flex-shrink: 0;
}

/* ============================================
   Google Maps風の時計ピッカー（削除予定）
   ============================================ */

.time-picker-modal {
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.time-picker-content {
    padding: 0 !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.time-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.time-picker-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
}

.time-picker-close {
    color: rgba(0, 0, 0, 0.54);
    cursor: pointer;
    transition: color 0.2s ease;
}

.time-picker-close:hover {
    color: rgba(0, 0, 0, 0.87);
}

.time-picker-body {
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.analog-clock-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.analog-clock {
    width: 240px;
    height: 240px;
    position: relative;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e0e0e0;
}

.clock-number {
    position: absolute;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
    z-index: 1;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.clock-hand {
    position: absolute;
    background: #2196F3;
    border-radius: 4px;
    transform-origin: bottom center;
    cursor: pointer;
    transition: transform 0.1s ease;
    z-index: 2;
}

.hour-hand {
    width: 4px;
    height: 68px;
    top: 52px;
    left: 50%;
    margin-left: -2px;
    background: #2196F3;
    border-radius: 2px;
}

.minute-hand {
    width: 3px;
    height: 94px;
    top: 26px;
    left: 50%;
    margin-left: -1.5px;
    background: #1976D2;
    border-radius: 2px;
}

.clock-center {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #2196F3;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    border: 2px solid #ffffff;
}

.time-display-section {
    text-align: center;
    flex-shrink: 0;
    width: 100%;
}

.time-display-value {
    font-size: 36px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.time-input-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-input-group label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-input {
    width: 70px;
    height: 44px;
    text-align: center;
    font-size: 20px;
    font-weight: 400;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    transition: all 0.2s ease;
}

.time-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.time-separator {
    font-size: 28px;
    color: rgba(0, 0, 0, 0.54);
    margin-top: 20px;
}

.time-picker-footer {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* 時計の針をドラッグ可能にする */
.clock-hand.dragging {
    transition: none;
}

.analog-clock {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.analog-clock:active {
    cursor: grabbing;
}

/* ナビゲーションバーのスタイル調整 */
nav {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   ヘッダー：ログイン状態表示（ul内に収める）
   ============================================ */
nav .nav-wrapper {
    height: 64px;
}

nav ul.right.hide-on-med-and-down {
    display: flex;
    align-items: center;
    height: 64px;
}

nav ul.right.hide-on-med-and-down > li {
    display: flex;
    align-items: center;
    height: 64px;
}

.login-status-nav {
    padding: 0 12px;
    max-width: 260px;
}

.login-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(245, 245, 245, 0.9);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.login-status-icon {
    font-size: 18px !important;
    line-height: 18px !important;
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.54);
}

.login-status-icon--ok {
    color: #4CAF50;
}

.login-status-icon--warn {
    color: #FF9800;
}

.login-status-label,
.login-status-name {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    color: rgba(0, 0, 0, 0.75);
}

.login-status-name {
    color: #2E7D32;
    font-weight: 600;
}

.login-status-sub {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

/* ============================================
   未ログイン時バナー（フォーム内）
   ============================================ */
.login-required-banner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    margin: 0 0 20px;
    border-radius: 8px;
    border: 1px solid #FFB74D;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.12);
    /* 縦に引き伸ばされないように固定 */
    align-self: flex-start;
    flex: none;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: hidden;
}

.login-required-banner__left {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.login-required-banner__icon {
    color: #F57C00;
    font-size: 24px;
    flex-shrink: 0;
    opacity: 0.9;
    align-self: flex-start;
}

.login-required-banner__text {
    flex: 1;
    min-width: 0;
    max-height: 100%;
    overflow: hidden;
}

.login-required-banner__title {
    font-weight: 600;
    color: #E65100;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 2px;
}

.login-required-banner__desc {
    color: #5D4037;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.85;
}

.login-required-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
}

.login-required-banner__actions .btn-small {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    text-transform: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.login-required-banner__actions .btn-small:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.login-required-banner__actions .btn-small .material-icons {
    font-size: 16px;
}

.login-required-banner__signup {
    border: 1px solid #2196F3 !important;
    background-color: white !important;
}

@media only screen and (max-width: 600px) {
    .login-status-nav {
        max-width: 220px;
        padding: 0 8px;
    }
    .login-status-name,
    .login-status-label {
        max-width: 110px;
    }
    .login-required-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
        max-height: none;
    }
    .login-required-banner__left {
        width: 100%;
    }
    .login-required-banner__actions {
        width: 100%;
        gap: 8px;
    }
    .login-required-banner__actions .btn-small {
        flex: 1;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
    }
}

/* 時間選択のクリック可能な値 */
.time-value-clickable:hover {
    background-color: #e3f2fd !important;
    color: #1976D2 !important;
}

.time-value-clickable:active {
    background-color: #bbdefb !important;
}

/* 時間選択プルダウンメニュー */
.time-dropdown-menu {
    font-family: 'Roboto', sans-serif;
}

.time-dropdown-option {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.time-dropdown-option:hover {
    background-color: #f5f5f5 !important;
}

.time-dropdown-option:active {
    background-color: #e0e0e0 !important;
}

/* スクロールアラームコンテナ */
.alarms-scroll-container {
    position: relative;
    height: 500px;
    overflow: hidden;
    padding: 20px 0;
    background: #f5f7fa;
    border-radius: 8px;
    white-space: nowrap;
}

/* スクロールリスト */
.alarms-scroll-list {
    display: inline-flex;
    flex-direction: row;
    gap: 20px;
    position: relative;
    animation: scrollLeft 120s linear infinite;
    will-change: transform;
    padding-right: 20px;
}

/* 複製されたリスト（無限ループ用） */
.alarms-scroll-list-clone {
    display: inline-flex;
    flex-direction: row;
    gap: 20px;
    position: absolute;
    left: 100%;
    top: 0;
    animation: scrollLeft 120s linear infinite;
    will-change: transform;
    padding-right: 20px;
}

/* 右から左へスクロールするアニメーション */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* アラームリスト項目 */
.alarm-list-item {
    display: inline-block;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    vertical-align: top;
    position: relative;
    top: var(--random-top, 0);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.alarm-list-item:hover {
    border-left-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    transform: translateY(-4px) scale(1.02);
    z-index: 10;
    position: relative;
}

/* 選択可能なアラームカード */
.selectable-alarm {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.selectable-alarm:hover {
    border-left-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    transform: translateX(4px) scale(1.02);
}

/* アラームリスト項目のカードスタイル */
.alarm-list-item .card {
    margin: 0;
    border-radius: 8px;
    height: 100%;
    overflow: hidden;
}

.alarm-list-item .card-content {
    padding: 16px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.alarm-list-item .card-content > div {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* アラームリスト項目の詳細文（35文字以上で省略、最大2-3行表示） */
.alarm-list-item .grey-text.text-darken-1 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    font-size: 0.85rem;
    color: #616161;
    max-height: 4.2em; /* 3行分の高さ（1.4 * 3） */
}

/* ============================================
   タブのスタイル（共通）
   ============================================ */
.tabs {
    margin: 0 !important;
    background-color: #fafafa;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
}

.tabs .tab {
    flex: 1;
    position: relative;
}

.tabs .tab a {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 16px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    transition: all 0.2s ease;
    position: relative;
    background: none;
    border: none;
}

.tabs .tab a.active {
    color: #2196F3;
    font-weight: 600;
    background-color: rgba(33, 150, 243, 0.05);
}

.tabs .tab a.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 3px;
    background-color: #2196F3;
    border-radius: 2px 2px 0 0;
    transition: all 0.3s ease;
}

.tabs .tab a:hover {
    color: #1976D2;
    background-color: rgba(33, 150, 243, 0.03);
}

.tabs .tab a:not(.active):hover {
    color: #1976D2;
}

.tabs .tab a .material-icons {
    font-size: 18px;
    float: none !important;
    margin-right: 4px !important;
    margin-left: 0 !important;
}

/* Materialize CSSのタブインジケーターを非表示（カスタム下線を使用） */
.tabs .indicator {
    display: none !important;
}

/* ============================================
   内側タブ（私のアラーム内）：セグメント（pill）風
   ============================================ */
.tabs.avis-inner-tabs {
    background: rgba(33, 150, 243, 0.06);
    border: 1px solid rgba(25, 118, 210, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    border-bottom: none;
    border-radius: 999px;
    /* Materializeのタブ既定（48px）に合わせてズレを無くす */
    padding: 6px;
    height: 48px;
    align-items: center;
    gap: 6px;
}

.tabs.avis-inner-tabs .tab {
    /* li(tab) の高さを揃えて、a(pill) を縦センターに置く */
    height: 48px;
    display: flex;
    align-items: center;
}

.tabs.avis-inner-tabs .tab a {
    border-radius: 999px;
    background: transparent;
    color: rgba(0, 0, 0, 0.62);
    padding: 0 14px;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 0.9rem;
    justify-content: center !important;
    gap: 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.tabs.avis-inner-tabs .tab a .material-icons {
    margin-right: 0 !important;
    color: rgba(25, 118, 210, 0.9);
}

.tabs.avis-inner-tabs .tab a:hover {
    /* 共通タブの hover 背景を上書きして「ボタンだけ反応」させる */
    background-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 1px 6px rgba(25, 118, 210, 0.12);
    color: rgba(0, 0, 0, 0.78);
    transform: translateY(-0.5px);
}

.tabs.avis-inner-tabs .tab a:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(25, 118, 210, 0.12);
}

.tabs.avis-inner-tabs .tab a.active {
    background: #ffffff;
    color: #1565C0;
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.18);
}

.tabs.avis-inner-tabs .tab a.active::after {
    display: none;
}

@media only screen and (max-width: 600px) {
    .tabs.avis-inner-tabs .tab a {
        font-size: 0.85rem;
        padding: 0 12px;
    }
    .tabs.avis-inner-tabs .avis-tab-label {
        display: none;
    }
}

/* ============================================
   通知一覧（Twitter風・読みやすいカード）
   ============================================ */
.avis-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avis-notification-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.avis-notification-item:hover {
    transform: translateY(-1px);
    border-color: rgba(25, 118, 210, 0.28);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.12);
}

.avis-notification-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.avis-notification-title {
    font-weight: 700;
    color: rgba(0, 0, 0, 0.82);
    line-height: 1.25;
    word-break: break-word;
}

.avis-notification-meta {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.avis-notification-body {
    margin-top: 8px;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: break-word;
}

.avis-notification-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.avis-notification-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(33, 150, 243, 0.08);
    color: #1565C0;
    font-size: 0.8rem;
    font-weight: 600;
}

.avis-notification-chip .material-icons {
    font-size: 16px;
}


/* 削除ボタンのスタイル */
.delete-alarm-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #f44336;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
    z-index: 10;
}

.delete-alarm-btn:hover {
    background-color: #d32f2f;
}

.delete-alarm-btn:active {
    background-color: #b71c1c;
}

/* モーダルフッターの高さを無効化 */
.modal .modal-footer {
    height: auto !important;
    min-height: 0 !important;
}

/* レスポンシブ対応：モバイルでの余白調整 */
@media only screen and (max-width: 600px) {
    body {
        font-size: 14px;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .row {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .avis-logo {
        font-size: 1.3rem;
    }

    nav .nav-wrapper {
        padding: 0 0.5rem;
    }

    nav ul.right {
        display: none;
    }

    /* アラームセクション全体を画面いっぱいに */
    .col.s12.m7 {
        padding: 0 !important;
        margin: 0 !important;
        height: calc(100vh - 64px); /* ヘッダーの高さを引く */
        display: flex;
        flex-direction: column;
    }


    /* スマホではタイトルを小さく */
    .alarms-section-title {
        margin: 0.5rem 1rem !important;
        padding: 0 !important;
        font-size: 1.1rem !important;
        flex-shrink: 0;
    }

    /* スマホではビューポートの高さに合わせて画面いっぱいに表示 */
    .alarms-scroll-container {
        height: calc(100vh - 64px - 48px - 48px); /* ヘッダー、タブ、検索トグルボタンの高さを引く */
        min-height: calc(100vh - 64px - 48px - 48px);
        max-height: calc(100vh - 64px - 48px - 48px);
        margin: 0;
        padding: 16px 0;
        flex: 1;
        overflow: hidden;
    }

    .alarms-scroll-list {
        gap: 16px;
        padding-right: 16px;
    }

    .alarms-scroll-list-clone {
        gap: 16px;
        padding-right: 16px;
    }

    .alarm-list-item {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .alarms-section-title .material-icons {
        font-size: 20px !important;
    }

    /* スマホ版ではフォームエリアを非表示（初期状態） */
    #alarmFormSection {
        display: none !important;
    }

    /* スマホ版でフォームが表示されている時 */
    #alarmFormSection.show-form {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        z-index: 999;
        background: rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        padding: 16px;
        box-sizing: border-box;
    }

    #alarmFormSection.show-form .alarm-form-card {
        margin: 0 auto;
        width: 90%;
        max-width: 480px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        background: #ffffff;
        position: relative;
        max-height: 90vh;
        overflow-y: auto;
        box-sizing: border-box;
    }

    /* フローティングアクションボタン（スマホ版のみ表示） */
    .alarm-fab {
        display: block !important;
        bottom: 24px !important;
        right: 24px !important;
        z-index: 998;
    }

    .alarm-fab .btn-floating {
        background-color: #2196F3 !important;
        box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
    }

    .alarm-fab .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(33, 150, 243, 0.6);
        transform: scale(1.1);
    }

    .alarm-list-item {
        margin-bottom: 10px;
    }

    .alarm-list-item .card-content {
        padding: 12px !important;
    }

    /* 私のアラームリストのスタイル */
    .my-alarms-list {
        max-height: calc(100vh - 64px - 48px - 1rem);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 8px;
        background-color: #fafafa;
    }

    .my-alarm-item {
        cursor: pointer;
        transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
        background-color: #ffffff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        border-left: 4px solid #2196F3 !important;
        padding: 16px !important;
        margin-bottom: 0 !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        position: relative;
    }

    .my-alarm-item:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
        background-color: #fafafa !important;
    }

    .my-alarm-item:active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
        transform: translateY(0);
    }

    .alarm-list-item .card-content > div > div:first-child {
        font-size: 0.9rem !important;
        margin-bottom: 4px !important;
    }

    .alarm-list-item .card-content > div > div:nth-child(2) {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
        max-height: 2.5em !important;
        line-height: 1.4 !important;
    }

    .alarm-list-item .card-content > div > div:nth-child(3) {
        font-size: 0.8rem !important;
    }

    .alarm-list-item .card-content .material-icons {
        font-size: 18px !important;
    }

    /* フォームエリアの調整 */
    .col.m5 {
        margin-top: 1.5rem;
    }

    .alarm-form-card {
        margin-bottom: 1rem;
    }

    .alarm-form-card .card-content {
        padding: 16px !important;
    }

    .alarm-form-card .card-title {
        font-size: 1.2rem !important;
        margin-bottom: 16px !important;
    }

    .alarm-form-card .card-title .material-icons {
        font-size: 22px !important;
    }

    .alarm-form-card .input-field {
        margin-bottom: 1rem;
    }

    .alarm-form-card .input-field input[type="text"] {
        font-size: 1rem !important;
        padding: 6px 0 !important;
    }

    .alarm-form-card .input-field .prefix {
        width: 2.5rem;
        font-size: 18px;
    }

    .alarm-form-card .input-field .prefix ~ input,
    .alarm-form-card .input-field .prefix ~ textarea {
        margin-left: 2.5rem;
        width: calc(100% - 2.5rem);
        font-size: 0.9rem !important;
    }

    .alarm-form-card .input-field label {
        font-size: 0.85rem !important;
    }

    .alarm-form-card .row {
        margin-bottom: 0;
    }

    .alarm-form-card .row .col {
        padding: 0 4px;
        margin-bottom: 0.5rem;
    }

    .alarm-form-card .row .col:last-child {
        margin-bottom: 0;
    }

    .alarm-form-card textarea {
        min-height: 70px !important;
        font-size: 0.9rem !important;
    }

    .alarm-form-card .btn,
    .alarm-form-card .btn-flat {
        font-size: 0.85rem;
        padding: 0 16px;
        height: 36px;
        line-height: 36px;
    }

    /* モバイル対応：Material Designピッカー */
    .material-datetime-section {
        margin-top: 20px;
    }

    .material-datetime-section .row {
        margin-left: 0;
        margin-right: 0;
    }

    .material-datetime-section .row .col {
        padding-left: 4px;
        padding-right: 4px;
        margin-bottom: 12px;
    }

    .material-datetime-section .row .col:last-child {
        margin-bottom: 0;
    }

    .material-picker-trigger {
        padding: 14px;
        min-height: 64px;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .material-picker-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .material-picker-icon i {
        font-size: 20px;
    }

    .material-picker-content {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 68px);
    }

    .material-picker-label {
        font-size: 11px;
        white-space: nowrap;
    }

    .material-picker-value {
        font-size: 15px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        line-height: 1.4;
    }

    .material-picker-hint {
        font-size: 11px;
        white-space: nowrap;
    }

    .material-picker-arrow {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .material-picker-arrow i {
        font-size: 18px;
    }

    /* モバイル対応：時間プルダウン */
    .time-picker-dropdown .time-picker-label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .time-select-wrapper {
        gap: 10px;
    }

    .time-select {
        height: 44px;
        padding: 10px 14px;
        font-size: 15px;
        padding-right: 36px;
    }

    .time-select option {
        font-size: 15px;
        padding: 6px;
    }

    .time-separator-text {
        font-size: 18px;
        line-height: 44px;
    }
}

/* 時間選択プルダウンモーダル */
.time-picker-dropdown-modal {
    width: 100%;
    margin-top: 16px;
}

.time-picker-dropdown-modal .time-select-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.time-picker-dropdown-modal .time-select-group {
    flex: 1;
    max-width: 200px;
    position: relative;
}

.time-picker-dropdown-modal .time-picker-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: 0.4px;
    line-height: 1.2;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.time-picker-dropdown-modal .time-select {
    width: 100%;
    height: 56px;
    padding: 16px;
    font-size: 18px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 24px;
    padding-right: 48px;
    box-sizing: border-box;
}

.time-picker-dropdown-modal .time-select:hover {
    border-color: #2196F3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.12);
}

.time-picker-dropdown-modal .time-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.time-picker-dropdown-modal .time-select option {
    padding: 12px;
    font-size: 18px;
}

.time-picker-dropdown-modal .time-separator-text {
    font-size: 24px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.54);
    line-height: 56px;
    flex-shrink: 0;
}

/* タブレット対応 */
/* デスクトップ版ではFABボタンを非表示、フォームは常に表示 */
@media only screen and (min-width: 601px) {
    .alarm-fab {
        display: none !important;
    }
    
    #alarmFormSection {
        display: block !important;
    }
}

@media only screen and (min-width: 601px) and (max-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }

    .alarms-scroll-container {
        height: 450px;
        padding: 20px 0;
    }

    .alarm-list-item {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
    }

    /* タブレット対応：Material Designピッカー */
    .material-picker-trigger {
        padding: 14px 16px;
        min-height: 68px;
        gap: 14px;
    }

    .material-picker-icon {
        width: 38px;
        height: 38px;
    }

    .material-picker-icon i {
        font-size: 22px;
    }

    .material-picker-label {
        font-size: 11.5px;
    }

    .material-picker-value {
        font-size: 15.5px;
    }

    .material-picker-hint {
        font-size: 11.5px;
    }
}

/* デスクトップ対応 - スマートフォンと同じスタイルを適用 */
@media only screen and (min-width: 993px) {
    /* コンテナの幅を960pxに設定 */
    .container {
        max-width: 960px !important;
        width: 100%;
        margin: 0 auto;
    }
    
    /* デスクトップでもスマートフォンと同じスタイルを適用 */
    .material-datetime-section {
        margin-top: 20px;
    }

    /* デスクトップ版でも時間プルダウンを正しく表示 */
    .time-picker-dropdown {
        width: 100%;
        margin-top: 0;
    }

    .time-picker-dropdown .time-picker-label {
        font-size: 12px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.6);
        letter-spacing: 0.4px;
        line-height: 1.2;
        text-transform: uppercase;
        margin-bottom: 8px;
        display: block;
    }

    .time-select-wrapper {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .time-select-group {
        flex: 1;
        position: relative;
    }

    .time-select {
        width: 100%;
        height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        font-weight: 400;
        color: rgba(0, 0, 0, 0.87);
        background: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 20px;
        padding-right: 40px;
        box-sizing: border-box;
    }

    .time-select:hover {
        border-color: #2196F3;
        box-shadow: 0 1px 3px rgba(33, 150, 243, 0.12);
    }

    .time-select:focus {
        outline: none;
        border-color: #2196F3;
        box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
    }

    .time-select option {
        padding: 8px;
        font-size: 16px;
    }

    .time-separator-text {
        font-size: 20px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.54);
        line-height: 48px;
        flex-shrink: 0;
    }

    .material-datetime-section .row {
        margin-left: 0;
        margin-right: 0;
    }

    .material-datetime-section .row .col {
        padding-left: 4px;
        padding-right: 4px;
        margin-bottom: 12px;
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .material-datetime-section .row .col:last-child {
        margin-bottom: 0;
    }

    .material-picker-trigger {
        padding: 14px;
        min-height: 64px;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .material-picker-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .material-picker-icon i {
        font-size: 20px;
    }

    .material-picker-content {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 68px);
    }

    .material-picker-label {
        font-size: 11px;
        white-space: nowrap;
    }

    .material-picker-value {
        font-size: 15px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        line-height: 1.4;
    }

    .material-picker-hint {
        font-size: 11px;
        white-space: nowrap;
    }

    .material-picker-arrow {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .material-picker-arrow i {
        font-size: 18px;
    }
}

/* ============================================
   コメントモーダル（みんなのアラーム）の統一デザイン
   ============================================ */

/* コメントモーダルの統一スタイル */
.modal-content {
    padding: 24px !important;
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    line-height: 1.5;
    color: #333;
}

/* タイトル（私のアラームと統一） */
.modal-content h4 {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    margin-bottom: 24px !important;
    color: #1976D2 !important;
    line-height: 1.4;
}

.modal-content h4 .material-icons {
    font-size: 1.4rem !important;
    vertical-align: middle;
}

/* 投稿者・日時情報 */
.modal-content > p.grey-text {
    font-size: 0.9rem !important;
    color: #757575 !important;
    margin-bottom: 16px !important;
    line-height: 1.5;
}

.modal-content > p.grey-text .material-icons {
    font-size: 16px !important;
    vertical-align: middle;
}

/* 詳細文セクション */
.alarm-detail-text {
    margin: 16px 0 !important;
    padding: 16px !important;
    background-color: #f5f5f5 !important;
    border-radius: 8px !important;
    line-height: 1.6 !important;
}

.alarm-detail-text strong {
    display: block !important;
    margin-bottom: 8px !important;
    color: #424242 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

.alarm-detail-text p {
    margin: 0 !important;
    color: #555 !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    line-height: 1.6 !important;
}

/* 区切り線 */
.modal-content hr {
    margin: 20px 0 !important;
    border: none !important;
    border-top: 1px solid #e0e0e0 !important;
}

/* コメント投稿セクション */
.modal-content h5 {
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    margin-bottom: 16px !important;
    color: #333 !important;
}

/* コメント入力欄 */
.modal-content .input-field textarea.materialize-textarea {
    font-size: 0.9rem !important;
    min-height: 80px !important;
    padding: 8px 0 !important;
    line-height: 1.5 !important;
}

.modal-content .input-field label {
    font-size: 0.9rem !important;
    color: #757575 !important;
}

/* モーダルフッター */
.modal-footer {
    padding: 16px 24px !important;
    border-top: 1px solid #e0e0e0 !important;
    height: auto !important;
    min-height: 0 !important;
}

.modal-footer .btn-flat {
    color: #757575 !important;
    font-size: 0.9rem !important;
}

.modal-footer .btn {
    font-size: 0.9rem !important;
    padding: 0 24px !important;
}

/* モバイル対応 */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px 16px !important;
    }

    .modal-content h4 {
        font-size: 1.2rem !important;
        margin-bottom: 20px !important;
    }

    .alarm-detail-text {
        padding: 12px !important;
    }

    .alarm-detail-text p {
        font-size: 0.9rem !important;
    }
}

/* ============================================
   ローディング・エラー状態のスタイル
   ============================================ */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.spinner-wrapper {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3f2fd;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-wrapper p {
    color: #757575;
    font-size: 0.9rem;
    margin: 0;
}

.error-message {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: #f44336;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 400px;
}

.error-message.show {
    opacity: 1;
    transform: translateX(0);
}

.error-message .material-icons {
    font-size: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #757575;
}

.empty-state .material-icons {
    font-size: 64px;
    color: #bdbdbd;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* スクリーンリーダー用の非表示テキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* いいねボタンのスタイル */
.like-btn {
    transition: transform 0.2s ease, color 0.2s ease;
}

.like-btn:hover {
    transform: scale(1.1);
}

.like-btn:active {
    transform: scale(0.95);
}

.like-btn .material-icons {
    transition: color 0.2s ease;
}

/* モーダル内のいいねボタンのスタイル */
.like-btn-modal {
    transition: transform 0.2s ease, color 0.2s ease;
}

.like-btn-modal:hover {
    transform: scale(1.1);
    background-color: rgba(244, 67, 54, 0.1) !important;
}

.like-btn-modal:active {
    transform: scale(0.95);
}

.like-btn-modal .material-icons {
    transition: color 0.2s ease;
}

/* 検索バーのスタイル */
.search-filter-bar .input-field {
    position: relative;
}

.search-filter-bar .input-field .prefix {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    text-align: center;
    pointer-events: none;
}

.search-filter-bar .input-field input {
    padding-left: 40px !important;
    box-sizing: border-box;
}

/* 検索・フィルターバーのレスポンシブ対応 */
@media only screen and (max-width: 600px) {
    /* モバイル版では検索バーを非表示（既にhide-on-med-and-downクラスで制御） */
    .search-filter-bar {
        display: none !important;
    }
    
    /* 検索トグルボタンのスタイル */
    .search-toggle-btn-container {
        border-bottom: 1px solid #e0e0e0;
    }
    
    .search-toggle-btn-container .btn-flat {
        width: 100%;
        justify-content: center;
    }
    
    /* 検索ポップアップのスタイル */
    #searchFilterModal .modal-content {
        padding: 16px !important;
    }
    
    #searchFilterModal .input-field {
        margin-bottom: 16px !important;
    }
    
    .filter-buttons-mobile {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .filter-btn-mobile {
        flex: 1;
        min-width: calc(50% - 4px);
        font-size: 0.9rem !important;
    }
    
    .error-message {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* レンダリング最適化：遅延読み込み */
.alarm-list-item:not(.loaded) {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.alarm-list-item.loaded {
    opacity: 1;
}

/* アラームを設定するボタンのモダンなスタイル */
.alarm-submit-btn {
    background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0 28px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 3px 8px rgba(66, 165, 245, 0.35), 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-transform: none !important;
    cursor: pointer !important;
    justify-content: center !important;
    white-space: nowrap !important;
    height: 44px !important;
    line-height: 44px !important;
    min-width: auto !important;
    width: auto !important;
}

/* キャンセルボタンのスタイル */
.alarm-cancel-btn {
    color: #757575 !important;
    padding: 0 20px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    height: 44px !important;
    line-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    min-width: auto !important;
    width: auto !important;
    border-radius: 50px !important;
    transition: all 0.2s ease !important;
}

.alarm-submit-btn:hover {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%) !important;
    box-shadow: 0 5px 12px rgba(66, 165, 245, 0.45), 0 2px 5px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

.alarm-submit-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 5px rgba(66, 165, 245, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.alarm-submit-btn .material-icons {
    font-size: 20px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* タブレット対応 */
@media only screen and (max-width: 992px) {
    .alarm-submit-btn {
        padding: 0 24px !important;
        font-size: 0.9rem !important;
        height: 42px !important;
        line-height: 42px !important;
        gap: 6px !important;
    }
    
    .alarm-submit-btn .material-icons {
        font-size: 18px !important;
    }
    
    .alarm-cancel-btn {
        padding: 0 18px !important;
        font-size: 0.9rem !important;
        height: 42px !important;
        line-height: 42px !important;
    }
}

/* モバイル対応 */
@media only screen and (max-width: 600px) {
    .alarm-submit-btn {
        padding: 0 20px !important;
        font-size: 0.85rem !important;
        height: 40px !important;
        line-height: 40px !important;
        gap: 6px !important;
    }
    
    .alarm-submit-btn .material-icons {
        font-size: 18px !important;
    }
    
    .alarm-cancel-btn {
        padding: 0 16px !important;
        font-size: 0.85rem !important;
        height: 40px !important;
        line-height: 40px !important;
    }
}

