/* ヘッダー固定スタイル */
.main-header {
    background: linear-gradient(135deg, #cc8fa8, #b63b62);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
}

.main-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.8px;
    line-height: 1.2;
}

.main-header .description {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.2px;
}

/* Footer Layout - 固定フッター */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.footer .actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.footer .footer-left {
    display: flex;
    align-items: center;
}

.footer .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-add-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-add-card:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.add-icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

/* メインコンテナのスクロール設定 */
.main-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-top: 130px; /* ヘッダーの高さ分のオフセット */
    padding-bottom: 100px; /* フッターの高さ分のオフセット */
}

.move-cards {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.move-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    min-width: 300px;
    overflow: hidden;
}

.move-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    flex: 1;
}

.btn-delete-card {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-delete-card:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.delete-icon {
    font-size: 14px;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-group:first-child {
    margin-bottom: 8px;
}

.item-select {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(11, 110, 246, 0.2);
}

.input-label {
    color: var(--muted-color);
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}

.store-input {
    width: 140px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.store-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(11, 110, 246, 0.2);
}

.quantity-input {
    width: 80px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(11, 110, 246, 0.2);
}


.unit {
    color: var(--muted-color);
    font-size: 14px;
    font-weight: 500;
    min-width: 30px;
}

/* Desktop layout */
@media (min-width: 768px) {
    .move-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .move-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.success-message {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 48px;
    color: var(--success-color);
    margin-bottom: 16px;
}

.btn-move {
    background: linear-gradient(135deg, #cc8fa8, #b63b62);
    color: white;
}

.btn-move:hover {
    background: linear-gradient(135deg, #cc8fa8, #b63b62);
}

.hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .content {
        padding: 15px;
        padding-top: 135px; /* モバイル用ヘッダーオフセット */
        padding-bottom: 120px; /* モバイル用フッターオフセット */
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .move-card {
        padding: 12px;
        min-width: auto;
    }

    .item-name {
        font-size: 15px;
    }

    .card-body {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .input-group {
        min-width: auto;
        width: 100%;
    }

    .footer .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .footer .footer-left,
    .footer .footer-right {
        justify-content: center;
    }

    .store-input {
        width: 120px;
        padding: 8px;
        font-size: 15px;
    }

    .quantity-input {
        width: 70px;
        padding: 8px;
        font-size: 15px;
    }

    .header-left {
        max-width: 100%;
        margin: auto;
        text-align: center;
    }

    .main-header {
        padding-left: 15px;
        padding-right: 15px;
    }

}

@media (max-width: 518px) {
    .content {
        padding-top: 150px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .move-card {
        padding: 10px;
        min-width: 100%;
    }

    .item-name {
        font-size: 14px;
    }

    .store-input {
        width: 100px;
        padding: 6px;
        font-size: 14px;
    }

    .quantity-input {
        width: 60px;
        padding: 6px;
        font-size: 14px;
    }

    .unit {
        font-size: 13px;
    }
}

.is-error {
    border: 1px solid red !important;
}

.error-message {
    color: red;
    font-size: 12px;
    margin-top: 4px;
    margin-left: 90px;
}

input:disabled, select:disabled {
    background-color: #ededed;
    cursor: not-allowed;
}
